construct balanced binary tree from sorted array
 get max N elements using a heap