+1 vote
in Data Structures & Algorithms I by (110k points)
Which of the following is incorrect with respect to binary trees?

(a) Let T be a binary tree. For every k ≥ 0, there are no more than 2k nodes in level k

(b) Let T be a binary tree with λ levels. Then T has no more than 2^λ – 1 nodes

(c) Let T be a binary tree with N nodes. Then the number of levels is at least ceil(log (N + 1))

(d) Let T be a binary tree with N nodes. Then the number of levels is at least floor(log (N + 1))

I want to ask this question from Binary Tree Properties in chapter Binary Trees of Data Structures & Algorithms I

The question was asked in semester exam.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct option is (d) Let T be a binary tree with N nodes. Then the number of levels is at least floor(log (N + 1))

To explain: In a binary tree, there are atmost 2k nodes in level k and 2^k-1 total number of nodes. Number of levels is at least ceil(log(N+1)).

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

...