Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App

Related Articles

UGC-NET | UGC-NET CS 2017 Dec 2 | Question 21

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

Consider an array representation of an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (i<=n), the index of the parent is: 



ceiling (i/2)


floor (i/2)


ceiling ((i+1)/2)


floor ((i+1)/2)

Answer: (B)


Refer: GATE-CS-2001 | Question 15 

To find parent of node at i index we have to find floor(i/2). 

So, option (C) is correct.

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Last Updated : 15 Mar, 2018
Like Article
Save Article
Similar Reads