+1 vote
in Data Structures & Algorithms I by (110k points)
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)/K

The question is from K-ary Tree in division Trees of Data Structures & Algorithms I

I got this question in a national level competition.

1 Answer

+1 vote
by (672k points)
selected by
Best 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.

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.