Skip to content

Branches - Kelsey #5

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

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

Branches - Kelsey #5

wants to merge 3 commits into from

Conversation

kelsk
Copy link

@kelsk kelsk commented Mar 20, 2020

Heaps Practice

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How is a Heap different from a Binary Search Tree? A heap maintains a parent/child relationship based on value (min-heaps have smaller parents, max-heaps have larger parents) but the sibling relationship isn't specified by smallest-to-largest values left-to-right
Could you build a heap with linked nodes? You could, but that seems unnecessarily complex when an array can keep a heap's order just fine.
Why is adding a node to a heap an O(log n) operation? We are traversing the number of levels in the heap (log n) not the number of nodes in the heap (n)
Were the heap_up & heap_down methods useful? Why? Yes, they were a quick and accurate way to determine the correct new location of nodes when adding/removing them.

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