Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amy W #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Amy W #13

wants to merge 4 commits into from

Conversation

amythetester
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 heap is not necessarily in sort order. A binary search tree must be in sort order or else it is just s binary tree.
Could you build a heap with linked nodes? You could, but I think it would need to be doubly links for it to work the same.
Why is adding a node to a heap an O(log n) operation? Because you are reducing the values you have to deal with in half for each heap_up operation.
Were the heap_up & heap_down methods useful? Why? 100%, they kept the add and remove methods simple. They also were able to be solely responsible for order.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. You hit all the learning goals here. Perfect solutions. Nice job.

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.

None yet

2 participants