BST with heapify and sorts