GATEverse Practice, past papers & mock tests
GATE 2006 · None
Programming & Data StructuresTreesmediumMCQ2 marks
A 3-ary max heap is like a binary max heap, but instead of 2 children, nodes have 3 children. A 3-ary heap can be represented by an array as follows: The root is stored in the first location, A[0], nodes in the next level, from left to right, are stored from A[1] to A[3]. The nodes from the second level of the tree from left to right are stored from A[4] onward. An item x can be inserted into a 3-ary heap containing n items by placing x in the location A[n] and pushing it up the tree to satisfy the heap property. Which one of the following is a valid sequence of elements in an array representing a 3-ary max heap?
Save your progress

Related Programming & Data Structures PYQs