Skip to content

Conversation

@indiakato
Copy link

Heaps Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How is a Heap different from a Binary Search Tree? A binary search tree is an ordered structure while a heap is not.
Could you build a heap with linked nodes? Yes
Why is adding a node to a heap an O(log n) operation? Worst case, we have to look at each level of the heap which is O(log n). Adding a node is O(1) so O(log n) + O(1) is O(log n)
Were the heap_up & heap_down methods useful? Why? Yes, these helper methods were useful because it allowed us to traverse each level and be able to add and remove from the heap.

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