+1 vote
in Data Structures & Algorithms I by (110k points)
A node of the weight balanced tree has

(a) key, left and right pointers, size

(b) key, value

(c) key, size

(d) key

The doubt is from Weight Balanced Tree topic in section Binary Trees of Data Structures & Algorithms I

This question was addressed to me in an online interview.

1 Answer

+1 vote
by (672k points)
Correct option is (a) key, left and right pointers, size

Best explanation: As a weight balanced tree stores height of the subtrees, we need to use size as an additional attribute to every node. also value(for mappings) may be an optional attribute.

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.

Categories

...