+1 vote
in Data Structures & Algorithms I by (88.2k points)
What is the node path length of a node with 0 or 1 child?

(a) 1

(b) -1

(c) 0

(d) null

The query is from Heap in chapter Heap of Data Structures & Algorithms I

This question was addressed to me in an interview for internship.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct answer is (c) 0

The explanation is: The length of the shortest path from a node to a node without two children is defined as 0.

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

...