Question DSA-TREE-0020
HardIn an array representation of a complete binary tree (0-indexed), where are the children of the node at index i?
- A.
2i and 2i + 1
- B.
i + 1 and 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
Trees question
In an array representation of a complete binary tree (0-indexed), where are the children of the node at index i?
2i and 2i + 1
i + 1 and i + 2
Sign up free to see the answer and a step-by-step explanation.
2i + 1 and 2i + 2
i/2 and i/2 + 1