LogIn
I don't have account.
Question 1
Which of the following is a type of binary tree where each node has at most two children?
1
Binary Tree
2
AVL Tree
3
Red-Black Tree
4
All of the above
Question 2
What is the time complexity of searching in a balanced Binary Search Tree (BST)?
1
O(n log n)
2
O(1)
3
O(log n)
4
O(n)
Question 3
What is the time complexity of finding the minimum element in a Binary Search Tree (BST) ( n is the number of element in BST and h is the height of BST) ?
1
O(log n)
2
O(h)
3
O(n)
4
O(log h)
Question 4
In which type of tree is the height balanced at every node?
1
Binary Search Tree (BST)
2
AVL Tree
3
Red-Black Tree
4
B-Tree
Question 5
What is the maximum number of nodes at level 'm' of a binary tree?
1
2^(m-1)
2
2*m
3
2^m
4
2^(m+1)
Question 6
What is a complete binary tree?
1
A tree where every node has exactly two children.
2
A tree where the left and right subtrees of every node are balanced.
3
A binary tree with only leaf nodes.
4
A tree where every level is fully filled except possibly the last level, which is filled from left to right.
Question 7
In a Red-Black Tree, which of the following properties hold?
1
Every node is either red or black.
2
The root is always black.
3
No two red nodes can be adjacent.
4
All of the above
Question 8
What is the time complexity of deleting a node from an AVL tree?
1
O(n log n)
2
O(n)
3
O(log n)
4
O(1)
Question 9
In a B-tree of order m, the maximum number of children a node can have is
1
m
2
m-1
3
2
4
None of the above
Question 10
What is the time complexity of an in-order traversal of a binary tree?
1
O(log n)
2
O(n)
3
O(n^2)
4
O(n log n)
Question 11
Which of the following is true about the post-order traversal of a binary tree?
1
Right subtree is visited before the left subtree.
2
Root node is visited last.
3
Root node is visited first.
4
Left subtree is visited before the right subtree.
Question 12
What is the maximum height of a binary tree with 'n' nodes?
1
n
2
n - 1
3
nlogn
4
log n
Question 13
In a Red-Black Tree, what is the color of the root node?
1
black
2
red
3
It can be either red or black
4
None of the above
Question 14
Which of the following operations on a Red-Black Tree can cause a violation of its properties?
1
Both insertion and deletion
2
Insertion
3
Deletion
4
Traversal
Question 15
In a balanced Binary Search Tree, which of the following operations can be performed in O(log n) time in the average case?
1
Search
2
Insert
3
Delete
4
All of the above
Question 16
What is the time complexity for deleting the root of a Min-Heap?
1
O(n log n)
2
O(1)
3
O(n)
4
O(log n)
Question 17
Which of the following tree types is best suited for implementing databases?
1
Binary Search Tree
2
AVL Tree
3
Red-Black Tree
4
B-Tree
Question 18
In Java, which data structure does HashMap internally use?
1
Binary Search Tree
2
Min Heap
3
Hash Table + Linked List + Red-Black Tree
4
Doubly Linked List