Closed dev-zuo closed 3 years ago
Heapify function error, in MinHeap, 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
it('heapify test', () => { let arr = [2, 5, 4, 1, 3, 6] expect(heap.heapify(arr)).to.deep.equal([1, 2, 4, 5, 3, 6]) })
Heapify function error, in MinHeap, 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