Part 7
Heaps and Balanced Trees
21lessons2 h 46 min0done
A binary search tree is fast, but only while it stays balanced. This part covers structures that keep the shape of a tree in check with rules. A heap is a complete tree that always keeps the smallest or the largest element at the root; it is the basis of priority queues and heap sort.
The part codes the heap first with an array, then with linked nodes. Then it works through the rotations, insertion and deletion of the AVL tree, introduces red-black trees and B-trees with their rules, and ends with exam questions.