97.0k views
3 votes
Consider a node R of a complete binary tree whose value is stored in position i of an array representation for the tree. If R has a left child, where will the left child's position be in the array?

a. 2∗i+2
b. (i−1)/2
c. i+1
d. None of the above

User Vielinko
by
8.7k points

1 Answer

2 votes

Final answer:

In a complete binary tree represented as an array, the left child of a node at position i will be at position 2*i + 1, which is not listed among the provided options, so the correct answer is 'None of the above'.

Step-by-step explanation:

If we consider a node R in a complete binary tree represented as an array, and the node R is stored at position i in the array, the position of R's left child will be 2*i + 1. This is because binary trees represented in an array have a specific pattern: the left child of a node at position i is at 2*i + 1, and the right child is at 2*i + 2. Therefore, the correct answer to the question is 'None of the above', since the options provided do not include 2*i + 1.

User Psychemaster
by
6.8k points