MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number ofnodes in a binary tree of height h is:
A
2^h-1
B
2^(h-1)-1
C
2^(h+1)-1
D
2*(h+1)
Explanation: 

Detailed explanation-1: -Maximum number of nodes present in binary tree of height h is 2h−1 . Here height is the max number of nodes on root to leaf path.

Detailed explanation-2: -The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is. No worries!

Detailed explanation-3: -This can be proved by induction. 2) Maximum number of nodes in a binary tree of height ‘h’ is 2h – 1. Here height of a tree is maximum number of nodes on root to leaf path. Height of a tree with single node is considered as 1.

Detailed explanation-4: -Since a binary tree can contain at most one node at level 0 (the root), it can contain at most 2l node at level l. 4. The total number of edges in a full binary tree with n node is n-1.

Detailed explanation-5: -The height of a binary tree is the height of the root node in the whole binary tree. In other words, the height of a binary tree is equal to the largest number of edges from the root to the most distant leaf node. A similar concept in a binary tree is the depth of the tree.

There is 1 question to complete.