14 votes 14 votes Which one of the following sequences when stored in an array at locations $A[1], \ldots, A[10]$ forms a max-heap? $23,17,10,6,13,14,1,5,7,12$ $23,17,14,7,13,10,1,5,6,12$ $23,17,14,6,13,10,1,5,7,15$ $23,14,17,1,10,13,16,12,7,5$ DS gatecse-2023 data-structures binary-heap 1-mark + – admin asked Feb 15, 2023 edited Mar 18, 2023 by Lakshman Bhaiya admin 6.5k views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Genius commented Feb 15, 2023 reply Follow Share B is answer 0 votes 0 votes Sabuj__Maity commented Feb 15, 2023 reply Follow Share The correct answer is Option B 0 votes 0 votes SarthakShastri commented Dec 12, 2023 reply Follow Share B is the correct Ans 0 votes 0 votes Please log in or register to add a comment.
8 votes 8 votes Answer: B Shoto answered Feb 15, 2023 Shoto comment Share Follow See all 0 reply Please log in or register to add a comment.
4 votes 4 votes Option (A) is wrong here because node $14$ comes after node $10$ Option (B) is a correct representation of the max heap. Option (C) is wrong here because node $15$ comes after node $13$. Option (D) is wrong here because node $12$ comes after node $1$. Note: Here we insert the given value one by one and check whether the value at root node $\geq$ to its children as a max heap, also it should be a complete binary tree. The max heap representation of option (B) is as follows: Ref: some max heap insertion questions from the previous year: GATE CSE 2014 Set 2 GATE CSE 2015 Set 3 GATE CSE 1996 GATE CSE 2005 Hira Thakur answered Feb 16, 2023 edited Feb 16, 2023 by Hira Thakur Hira Thakur comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes Answer: B Souvik33 answered Mar 30, 2023 Souvik33 comment Share Follow See all 0 reply Please log in or register to add a comment.