Remove live code & console.log, leave examples as comments.

This commit is contained in:
Eric Lavault
2021-10-11 14:07:10 +02:00
parent 90356f340d
commit e18718b7d5
14 changed files with 64 additions and 59 deletions

View File

@ -71,15 +71,15 @@ class BinaryHeap {
}
}
const maxHeap = new BinaryHeap()
maxHeap.insert([4])
maxHeap.insert([3])
maxHeap.insert([6])
maxHeap.insert([1])
maxHeap.insert([8])
maxHeap.insert([2])
// Example
while (!maxHeap.empty()) {
const mx = maxHeap.extractMax()
console.log(mx)
}
// const maxHeap = new BinaryHeap()
// maxHeap.insert([4])
// maxHeap.insert([3])
// maxHeap.insert([6])
// maxHeap.insert([1])
// maxHeap.insert([8])
// maxHeap.insert([2])
// const mx = maxHeap.extractMax()
export { BinaryHeap }