Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.

Data Structures :: Trees

Home > Data Structures > Trees > General Questions

1. 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: 7 6

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

2. 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: printf("%d", tree->info); preorder(tree->left); preorder(tree->right);

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: Search, Insert and Delete Operations

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:

No Tags on this question yet!

4. A full binary tree with 2n+1 nodes contain

Answer: n non-leaf nodes

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: no right child

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

6. 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: full binary tree.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

7. A full binary tree with n leaves contains

Answer: (2n-1) nodes.

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

8. The number of different directed trees with 3 nodes are

Answer: 3

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: postorder

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!

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

Answer: 2^d

Explanation:

Here is no explanation for this answer

Workspace

Tags:

No Tags on this question yet!