Differentiate between heap structure and binary search tree.
Answers
Answered by
1
Answer:
Explanation:
The main difference is that Binary Search Tree doesn’t allow duplicates, however, the Heap does. The BST is ordered, but the Heap is not. So, if order matters, then it is better to use BST. If an order is not relevant, but we need to be sure that insert and remove will take time, then the Heap guarantees to achieve this time.
Answered by
1
Answer:
The Heap differs from a Binary Search Tree. The BST is an ordered data structure, however, the Heap is not. In computer memory, the heap is usually represented as an array of numbers. ... Similarly, the main rule of the Max-Heap is that the subtree under each node contains values less or equal than its root node.
Similar questions