Question DSA-HEAP-0024
EasyIn an array-based binary heap (0-indexed), where are the children of the element at index i?
- A.
At 2i and 2i + 1
- B.
At i/2 and i/2 + 1
- 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
In an array-based binary heap (0-indexed), where are the children of the element at index i?
At 2i and 2i + 1
At i/2 and i/2 + 1
Sign up free to see the answer and a step-by-step explanation.
At 2i + 1 and 2i + 2
At i + 1 and i + 2