Skip to content

Conversation

@TaylorMililani
Copy link

Heaps Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How is a Heap different from a Binary Search Tree? BSTs do not allow duplicate values, while heaps do. Also, bsts are ordered and heaps are not.
Could you build a heap with linked nodes? yes but arrays are a lot easier and make more sense
Why is adding a node to a heap an O(log n) operation? while adding an element is O(1), swapping is O(N) so therefore its O(logn)
Were the heap_up & heap_down methods useful? Why? yes, because those methods compared the nodes and got them in the right places

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant