Fix heap implementation

This commit is contained in:
Leonid Logvinov 2017-11-17 13:02:17 -06:00
parent 88d020f9f2
commit b7585318c7
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4

View File

@ -82,6 +82,9 @@ export class Heap<T> {
}
}
}
if (swap === n) {
break;
}
this.content[n] = this.content[swap];
this.content[swap] = element;
n = swap;