Statement for Linked Answer Questions 76 & 77:
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, , nodes in the next level, from left to right, is stored from to . The nodes from the second level of the tree from left to right are stored from location onward. An item can be inserted into a 3-ary heap containing items by placing in the location and pushing it up the tree to satisfy the heap property.
76. Which one of the following is a valid sequence of elements in an array representing ary max heap?
- 1,3,5,6,8,9
- 9,6,3,1,8,5
- 9,3,6,8,5,1
- 9,5,6,8,3,1
77. Suppose the elements and 4 are inserted, in that order, into the valid 3-ary max heap found in the previous question, Q.76. Which one of the following is the sequence of items in the array representing the resultant heap?