• Home
  • Textbooks
  • Data Structures Using C
  • Nonlinear Data Structures: Trees

Data Structures Using C

Amol M. Jagtap, Ajit S. Mali

Chapter 5

Nonlinear Data Structures: Trees - all with Video Answers

Educators


Chapter Questions

Problem 1

Assume that we have numbers between 1 and 1000 in a BST and want to search for the number 363. Which of the below ordering could not be the ordering of the node reviewed?
A. $2,252,401,398,330,344,397,363$
B. $924,220,911,244,898,258,362,363$
C. $925,202,911,240,912,245,258,363$
D. $2,399,387,219,266,382,381,278,363$

Check back soon!

Problem 2

In a complete binary tree or perfect binary tree, every inner node has exactly two children. If there are 21 leaf nodes or exterior nodes in the tree, how many internal nodes are there in the perfect binary tree?
A. 19
B. 20
C. 22
D. 18

Check back soon!

Problem 3

Which type of traversal of BST produces the value in ascending sorted order?
A. Preorder traversal
B. Post-order traversal
C. In-order traversal
D. All of the above

Check back soon!

Problem 4

A 2-3 is a type of tree which is having the following properties,
a. 2-3 tree's all internal nodes have either two or three children.
b. 2-3 tree's all paths from root to leaves have the same length
c. Then the number of internal nodes of a 2-3 tree having nine leaves could be
A. 4 or 8
B. 5 or 9
C. 6 or 7
D. 7 or 4

Check back soon!

Problem 5

If a node has two children that node we want to delete from a BST, then that deleted node must be replaced by its
A. In-order successor
B. In-order predecessor
C. Post-order successor
D. Post-order predecessor

Check back soon!

Problem 6

A BST is formed from the given sequence $6,9,1,2,7,14,12,3,8$ and 18 . The minimum number of nodes required to be added into this tree to form an extended binary tree is?
A. 3
B. 6
C. 8
D. 11

Check back soon!

Problem 7

In a full binary tree, every internal node has exactly two children. A full binary tree with $2 n+1$ nodes contains,
A. 2 n leaf nodes
B. $\mathrm{n}+1$ internal nodes
C. $\mathrm{n}+1$ exterior nodes
D. n-1 internal nodes

Check back soon!

Problem 8

If n numbers are to be sorted in ascending order in $\mathrm{O}(\mathrm{n} \log \mathrm{n})$ time, which of the following tree can be used
A. Binary tree
B. Binary search tree
C. Max-heap
D. Min-heap

Check back soon!

Problem 9

If n elements are sorted in a balanced BST. What would be the asymptotic complexity to search a key in the tree?
A. $\mathrm{AO}(1)$
B. $O(\log n)$
C. $\mathrm{O}(\mathrm{n})$
D. $\mathrm{O}(\mathrm{nlogn})$

Check back soon!

Problem 10

In which of the following tree, parent node has a key value greater than or equal to the key value of both of its children?
A. Binary search tree
B. Threaded binary tree
C. Complete binary tree
D. Max-heap

Check back soon!

Problem 11

A complete binary tree T has n leaf nodes. The number of nodes of degree 2 in T is
A. $\log _2 n$
B. $\mathrm{n}-1$
C. n
D. $2^{\mathrm{n}}$

Check back soon!

Problem 12

A BST is generated by inserting in order the following integers: $50,15,62,5,20,58,91,3,8$, 37,60 and 24.
The number of the node in the left sub-tree and right sub-tree of the root, respectively, is
A. $(4,7)$
B. $(7,4)$
C. $(8,3)$
D. $(3,8)$

Check back soon!

Problem 13

The number of edges or links from the root node to the deepest leaf is called $\qquad$ of the tree.
A. Height
B. Depth
C. Length
D. Width

Check back soon!

Problem 13

In a complete binary tree or a proper binary tree or a strictly binary tree if the number of internal nodes is N , then the number of leaves or exterior nodes, E are?
A. $E=2 * N-1$
B. $\mathbf{E}=\mathbf{N}+1$
C. $E=N-1$
D. $E=N-2 N$

Check back soon!

Problem 14

Which of the following statements is false or true?
1. A full binary tree or a proper binary tree or a strictly binary tree is a binary tree in which each node other than the leaves has one or two children.
2. All complete binary trees are strictly binary trees, but all strictly binary trees are not complete binary trees.
A. Statement 1 is false.
B. Statement 2 is false.
C. Statements 1 and 2 both are false.
D. Statements 1 and 2 both are true.

Check back soon!

Problem 15

Which type of binary tree produces the value in ascending sorted order when it is traversed?
A. Binary search tree
B. Complete binary tree
C. Strictly binary tree
D. Almost complete binary tree

Check back soon!

Problem 16

Which of the following statements is false or true?
1. If a tree is dominated by the left child node or right child node, it is said to be a skewed binary tree.
2. Forest is the disjoint union of trees.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true

Check back soon!

Problem 17

Which of the following statements is false or true?
1. An AVL tree is also a BST, but it is a balanced tree.
2. Every AVL Tree is a BST, and all the BSTs are also AVL trees.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true

Check back soon!

Problem 18

Which of the following statements is false or true?
1. B tree is a binary tree.
2. $\mathrm{B}+$ tree is used to provide indexed sequential file organization.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true

Check back soon!

Problem 19

Which of the following statements is false or true?
1. In a B+ tree, the search operation is different than that of BST.

2 . Internal sorting purpose $\mathrm{B}+$ tree is used.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true

Check back soon!

Problem 20

Which of the following statements is false or true with respect to a $\mathrm{B}+$ tree?
1. In a B+ tree, all the leaf nodes must be at the same level.
2. In a B+ tree, all leaves have been connected to form a linked list of keys in sequential order.
A. Statement 1 is false
B. Statement 2 is false
C. Statements 1 and 2 both are false
D. Statements 1 and 2 both are true

Check back soon!