1.

Which one of the following is the correct formulae to find the parent node at index I?(a) (I-1)/K(b) (I+1)/K(c) (I*1)/K(d) (I-2)/KThe question is from K-ary Tree in division Trees of Data Structures & Algorithms II got this question in a national level competition.

Answer»

The correct OPTION is (a) (I-1)/K

To explain: The PARENT node for the node of INDEX I in a K-ary tree is GIVEN by (I-1)/K.



Discussion

No Comment Found

Related InterviewSolutions