Fix heap implementation
This commit is contained in:
parent
88d020f9f2
commit
b7585318c7
@ -82,6 +82,9 @@ export class Heap<T> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (swap === n) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
this.content[n] = this.content[swap];
|
this.content[n] = this.content[swap];
|
||||||
this.content[swap] = element;
|
this.content[swap] = element;
|
||||||
n = swap;
|
n = swap;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user