25 25 votes Which of the following sequences of array elements forms a heap? $\{23, 17, 14, 6, 13, 10, 1, 12, 7, 5\}$ $\{23, 17, 14, 6, 13, 10, 1, 5, 7, 12\}$ $\{23, 17, 14, 7, 13, 10, 1, 5, 6, 12\}$ $\{23, 17, 14, 7, 13, 10, 1, 12, 5, 7\}$ Data Structures gateit-2006 data-structures binary-heap easy + – Ishrat Jahan 9.6k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Asim Siddiqui 4 commented Nov 28, 2018 reply Follow flag https://www.geeksforgeeks.org/gate-gate-it-2006-question-44/ refer this link for more simpler answer 0 0 replyShare neeraj_bhatt commented Dec 18, 2019 reply Follow flag How to decide whether to go with 2-ary heap or 3-ary heap? 0 0 replyShare Rohit139 commented Dec 27, 2024 reply Follow flag this is Max heap option c 23------>17,14 17-------->7,13 14--------->10,1 7----------->5,6 13----------->12 1 1 replyShare Please log in or register to add a comment.
Best answer 28 28 votes For a heap(max heap) parent should be greater than or equal to children. in a heap of $[1..n]$ left child of ith node will be at $2*i$ th position and right child will be at $2*i+1$ position. So, for given options we can verify it. . Option C seems to be following the property. Sankaranarayanan P.N answered Nov 14, 2014 • edited Jun 13, 2018 by Milicevic3306 Sankaranarayanan P.N comment Share Follow See 1 comment 1 1 comment reply Gate Ranker18 commented Aug 23, 2017 reply Follow flag where is it mentioned whether it is binary max heap or ternary max heap? if I solve using ternary max heap then all options are correct. is by default heap is the binary heap? 0 0 replyShare Please log in or register to add a comment.