mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
Remove live code & console.log, leave examples as comments.
This commit is contained in:
@ -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 }
|
||||
|
Reference in New Issue
Block a user