Heaps vs. Binary Trees - How to implement?
arrays, binary-tree, data-structures, heap, pointers
Solution
Personally
Because using pointers its easier to grow the data structure size dynamically
I find It's easier to maintain bin tree than a heap
The algorithms to balance, remove, insert elements in the tree will alter only pointers and not move then physically as in a vector.
and so on...
Problem
when implementing a heap structure, we can store the data in an array such that the children of the node at position i are at position 2i and 2i+1. my question is, why dont we use an array to represent binary search trees and instead we deal with pointers etc.? thanks