MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
TREE[1]=NULL indicates is ____
A
Overflow
B
Empty
C
Underflow
D
Full
Explanation: 

Detailed explanation-1: -Again, Null is used to indicate an empty sub tree in particular, TREE[1]= NULL indicates that the tree is empty. This representation schema is quite waste of space when many elements are mission.

Detailed explanation-2: -An empty tree has no members. If the root of T contains x, then tree T clearly contains x. If the root of T contains k and x < k then, if x occurs in T at all, it must occur in T’s left subtree, by the ordering requirement for binary search trees.

Detailed explanation-3: -// If the root is NULL, the tree is empty, so it is a perfect binary tree. // If the root is a leaf node, then the tree is a perfect binary tree.

Detailed explanation-4: -(definition) Definition: (1) A tree which is empty. (2) A tree whose leaf nodes all have a null value.

Detailed explanation-5: -This traversal first goes over the left subtree of the root node, then accesses the current node, followed by the right subtree of the current node. The code represents the base case too, which says that an empty tree is also a binary search tree.

There is 1 question to complete.