What are the types of heaps?
max-heaps and min-heaps
What are heaps mainly used for?
Heap sorts and priority queues
What is a max-heap?
Max heaps are where the value of i is less than or equal to the value of their parent.
The parent is always bigger
What is a min-heap?
Minheaps are where the value of i is greater than or equal to the value of their parent.
The parent is always smaller
Height of a heap?
O(logn)
Visualized as an array, where is the root?
At index 1
Visualized as an array, where is the left child?
left(i) = 2*i
Visualized as an array, where is the right child?
right(i) = 2 * i +1
Visualized as an array, how to get to the parent?
parent(i) = floor(i/2)