Skip to content

Conversation

@idago123
Copy link

Heaps Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How is a Heap different from a Binary Search Tree? In a binary tree each level is full except the last, and the last level is filled from left-to-right. In a heap each parent has a specific order-relationship with it's children.
Could you build a heap with linked nodes? Yes
Why is adding a node to a heap an O(log n) operation? The heap-up operation will at worst-case perform 1 swap per level of the heap. Since there are Log n levels to the heap, adding a node is a O(log n) operation.
Were the heap_up & heap_down methods useful? Why? Yes for sorting

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