Data Structures :: Trees

Home > Data Structures > Trees > General Questions

1 / 33

 What are the number of nodes of left and right subtree of the binary tree if the data is inserted in the following order: 45, 15, 8, 5 6, 5, 65, 47, 12, 18, 10, 73, 50, 16, 61

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  Commvault

2 / 33

 Consider the following code segment in C to traverse a binary tree using the preorder

typedef struct tree {
int info;
struct *left;
struct *right;
}node;

void preorder(node *tree)
{
if (t)
{
Statementl
Statement2
Statement3
}
}
The above Statements should be

Answer: Option D

Explanation:

Here is no explanation for this answer

Workspace


Tags:  Commvault Capgemini

3 / 33

 The worst case time complexity of AVL tree is better in comparison to binary search tree for

Answer: Option D

Explanation:

Search is O(log N) since AVL trees are always balanced. Insertion and deletions are also O(logn) where as in case of BST it is O(n).

Workspace


Tags:  Wipro

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

5 / 33

 If a node in a BST has two children, then its inorder predecessor has

Answer: Option B

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

6 / 33

 A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is known as

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

7 / 33

 A full binary tree with n leaves contains

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

8 / 33

 The number of different directed trees with 3 nodes are

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

9 / 33

 One can convert a binary tree into its mirror image by traversing it in

Answer: Option C

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!

10 / 33

 The number of leaf nodes in a complete binary tree of depth d is

Answer: Option A

Explanation:

Here is no explanation for this answer

Workspace


Tags:  No Tags on this question yet!