Heaps Flashcards

1
Q

What is a heap?

A

special binary tree, where each node has a value that is equal or lower value than the parent.

The root always contains the highest priority.

No horizontal relationship between nodes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Min Heap vs Max Heap

A

A min-heap sorts values from smallest to largest. The root node will always have the smallest value in the heap.
A max-heap sorts values from largest to smallest. The root node will always have the largest value in the heap.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly