recategorized
3,554 views
0 votes
0 votes

A binary search tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 19 leaves:

  1. cannot have more than 37 nodes
  2. has exactly 37 nodes
  3. has exactly 35 nodes
  4. cannot have more than 35 nodes
recategorized

8 Answers

3 votes
3 votes

can not have more than 37 nodes....

in worst case the tree formation like, 

 

 

in Best case and Worst Case also we have 37 nodes ===> has exactly 37 nodes

0 votes
0 votes

Question is talking about Complete Binary Tree.

"A Complete Binary Tree(CBT) of depth d is a Strictly Binary Tree all of whose leaves are at level d".

If n is  number of leaves in CBT then Total maximum number of Nodes in CBT=2n-1

Here n=19 so Option (1) Can not have more than 37 Nodes.

Related questions

1 votes
1 votes
3 answers
1
Pooja Khatri asked Jul 13, 2018
3,428 views
Consider the array A=<4, 1, 3, 2, 16, 9, 10, 14, 8, 7>. After building heap from the array A, the depth of the heap and the right child of max-heap are ______ and _____ r...
0 votes
0 votes
2 answers
2
Pooja Khatri asked Jul 13, 2018
8,953 views
A hash function h defined h(key)=key mod 7, with linear probing, is used to insert the keys 44, 45, 79, 55, 91, 18, 63 into a table indexed from 0 to 6. What will be the ...
0 votes
0 votes
2 answers
3
Pooja Khatri asked Jul 13, 2018
2,603 views
Which of the following algorithms solves the single-source shortest paths?Prim's algorithmFloys-Warshall algorithmJohnson's algorithmDijkstra's algorithm
2 votes
2 votes
3 answers
4
Pooja Khatri asked Jul 13, 2018
17,192 views
The maximum number of comparisons needed to sort 9 items using radix sort is (assume each item is 5 digit octal number):4572360450