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(1)
2
O(log n)
3
O(n 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 h)
2
O(h)
3
O(n)
4
O(log n)
Question 4
In which type of tree is the height balanced at every node?
1
B-Tree
2
AVL Tree
3
Red-Black Tree
4
Binary Search Tree (BST)
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 level is fully filled except possibly the last level, which is filled from left to right.
2
A tree where the left and right subtrees of every node are balanced.
3
A tree where every node has exactly two children.
4
A binary tree with only leaf nodes.
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(log n)
2
O(n log n)
3
O(1)
4
O(n)
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(n log n)
2
O(n)
3
O(n^2)
4
O(log n)
Question 11
Which of the following is true about the post-order traversal of a binary tree?
1
Root node is visited first.
2
Left subtree is visited before the right subtree.
3
Root node is visited last.
4
Right subtree is visited before the left subtree.
Question 12
What is the maximum height of a binary tree with 'n' nodes?
1
nlogn
2
log n
3
n
4
n - 1
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
Deletion
2
Traversal
3
Both insertion and deletion
4
Insertion
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(1)
2
O(n log n)
3
O(n)
4
O(log n)
Question 17
Which of the following tree types is best suited for implementing databases?
1
AVL Tree
2
B-Tree
3
Binary Search Tree
4
Red-Black Tree
Question 18
In Java, which data structure does HashMap internally use?
1
Hash Table + Linked List + Red-Black Tree
2
Binary Search Tree
3
Doubly Linked List
4
Min Heap