When making a binary max heap, why is it better to implement it as a array based, and not a tree based (tree based as in, each node also having a pointer to it's parent)? In terms of run time analysis, memory usage, performance...
For binary max heap, the running times are:
- insert: O(lg n)
- delete min: O(lg n)
- merge: O(n)
For a tree implementation
- insert: O(lg n)
- delete min: O(lg n)
- merge: O(n)
Can anyone explain in detail?