Jane Street Interview Question

Third round: Given an array with a heap property, how do I insert and delete elements into the heap while maintaining the heap property. Followed up by, how to recursively delete the entire subtree.

Interview Answer

Anonymous

Dec 8, 2015

what do you mean by "subtree"? because the heap is a COMPLETE binary tree, it's not possible to have a subtree deleted

1