Question DSA-HEAP-0071
HardWhat is the index of the parent of node i in a 1-indexed array heap?
- A.
2i
- B.
⌊i/2⌋
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Heaps and Priority Queues question
What is the index of the parent of node i in a 1-indexed array heap?
2i
⌊i/2⌋
Sign up free to see the answer and a step-by-step explanation.
(i − 1)/2
i − 1