You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The heap.png image in the readme (https://raw.githubusercontent.com/kdn251/interviews/master/images/heap.png) shows a tree that does indeed respect the heap order property. The problem is when you mention the time complexities. In order to have O(log(n)) insert / remove time you also need for your heap to be a complete binary tree. The heap in the picture is not a complete binary tree. I think it should at least be mentioned in the description that the property is only valid for such trees, otherwise it is somewhat misleading.
The text was updated successfully, but these errors were encountered:
The heap.png image in the readme (https://raw.githubusercontent.com/kdn251/interviews/master/images/heap.png) shows a tree that does indeed respect the heap order property. The problem is when you mention the time complexities. In order to have O(log(n)) insert / remove time you also need for your heap to be a complete binary tree. The heap in the picture is not a complete binary tree. I think it should at least be mentioned in the description that the property is only valid for such trees, otherwise it is somewhat misleading.
The text was updated successfully, but these errors were encountered: