What is the worst-case time complexity for inserting a node into a Red-Black Tree?
O(n log n)
O(1)
O(n)
O(log n)
You have serialized a binary tree using preorder traversal with null markers. During deserialization, which data structure is MOST suitable for efficiently reconstructing the tree from the serialized string?
Heap
Stack
Queue
Linked List
In an AVL Tree, what is the maximum allowed height difference between the left and right subtrees of any node?
2
3
1
0
What is the primary advantage of using a Fenwick tree over a segment tree for range sum queries?
Fenwick trees have faster update operations
Fenwick trees support a wider range of queries
Fenwick trees use less memory
Fenwick trees are easier to implement
What is the maximum number of nodes in a binary tree of height 'h'?
2^(h+1) - 1
2^h
2h - 1
h + 1
Consider a Binary Search Tree (BST). What is the time complexity of finding the LCA of two nodes in the BEST-CASE scenario?
In a Perfect Binary Tree with height 'h', what is the maximum number of nodes it can have?
h^2
2h + 1
2^h - 1
Which of the following is NOT a type of self-balancing BST?
Red-Black Tree
AVL Tree
B-Tree
Binary Heap
You want to print the nodes of a binary tree in a way that nodes at the same level are printed together, from left to right. Which traversal method achieves this?
Postorder Traversal
Inorder Traversal
Level Order Traversal
Preorder Traversal
A certain algorithm requires a binary tree where all operations (insertion, deletion, search) must be guaranteed to be O(log n) in the worst case. Which type of tree is MOST suitable for this scenario?
Complete Binary Tree
Balanced Binary Tree
Full Binary Tree
Perfect Binary Tree