0
4.1kviews
What is heap? Consider the following list of numbers: 15, 19, 10, 7, 17, 16 Sort these numbers using heap sort.

Mumbai University > COMPS > Sem 3 > Data Structures

Marks: 10 M

Year: May 2015

1 Answer
0
128views
  • A heap is a special kind of tree-based data structure.
  • A heap is a complete binary tree in which every node satisfies the Heap property which states that: “The node_value(A) ≥ node_value(B) where B is a Child of A”
  • This means that at elements at every node will be having a value greater than or equal to its parent element. That means, the root node will be having the highest value in the tree.
  • Such kind of tree is popularly called as max-heap.
  • A tree which works in exactly the opposite fashion of the above mentioned property is called as min-heap.
  • The root element of a min-heap will be having the lowest value.

enter image description here

Please log in to add an answer.