CSE 373 Lecture 7: CSE 373 Lecture 7
CSE 373 Lecture 7
- Implementing removeMin()
o Replace removed root w most recently added node:
o Rebalance by percolating down
▪ Recursively swap parent w smallest child
▪
- Implementing insert() – always go down from unfilled level, + insert furthest left
o Rebalance by percolating up
▪ Recursively swap child w parent
Friday, May 4, 2018
Implementing Heaps with an array
- Fill in level order, left to right