LogIn
I don't have account.

Practice tree Quizzes

Strengthen your understanding of tree with DevBrainiac's interactive quizzes designed for learners at every level. These quizzes help you practice essential concepts, improve accuracy and build a strong technical foundation. With instant feedback and topic-focused questions, you can easily identify weak areas and boost your confidence for exams and coding interviews.

Explore All tree Quizzes

Learn tree step by step with interactive quizzes designed for beginners and learners revising key concepts. Build a strong foundation with clear, structured practice in tree.
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)
2
O(1)
3
O(log n)
4
O(n log 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(log h)
3
O(n)
4
O(h)
Question 4
In which type of tree is the height balanced at every node?
1
Binary Search Tree (BST)
2
Red-Black Tree
3
AVL Tree
4
B-Tree
Question 5
What is the maximum number of nodes at level 'm' of a binary tree?
1
2*m
2
2^m
3
2^(m-1)
4
2^(m+1)
Question 6
What is a complete binary tree?
1
A tree where every node has exactly two children.
2
A binary tree with only leaf nodes.
3
A tree where every level is fully filled except possibly the last level, which is filled from left to right.
4
A tree where the left and right subtrees of every node are balanced.
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)
3
O(n 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(n)
2
O(log 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
Left subtree is visited before the right subtree.
3
Root node is visited last.
4
Root node is visited first.
Question 12
What is the maximum height of a binary tree with 'n' nodes?
1
n
2
log n
3
n - 1
4
nlogn
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
Insertion
2
Traversal
3
Both insertion and deletion
4
Deletion
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(log n)
2
O(n)
3
O(1)
4
O(n log n)
Question 17
Which of the following tree types is best suited for implementing databases?
1
AVL Tree
2
Binary Search Tree
3
Red-Black Tree
4
B-Tree
Question 18
In Java, which data structure does HashMap internally use?
1
Doubly Linked List
2
Hash Table + Linked List + Red-Black Tree
3
Min Heap
4
Binary Search Tree