Commit d73ee43
authored
Fix heapify error
Heapify function error, heapify([2, 5, 4, 1, 3, 6]) result is [ 2, 1, 4, 5, 3, 6 ], should be [1, 2, 4, 5, 3, 6]
test case
```js
it('heapify test', () => {
let arr = [2, 5, 4, 1, 3, 6]
expect(heap.heapify(arr)).to.deep.equal([1, 2, 4, 5, 3, 6])
})
```1 parent cc55deb commit d73ee43
File tree
1 file changed
+1
-1
lines changed- LearningJavaScriptDataStructuresandAlgorithmsThirdEdition_Code/src/js/data-structures
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
0 commit comments