Tree Flashcards
1
Q
Tree as an Array
How do you find the Child?
How do you find the parent?
A
left child :( 2i+1);
right child: (2i+2)
parent : (i-1)/2
CodingInterview > Tree > Flashcards
Tree as an Array
How do you find the Child?
How do you find the parent?
left child :( 2i+1);
right child: (2i+2)
parent : (i-1)/2