What is the maximum number of nodes in a binary tree of height 'h'?
2^(h+1) - 1
h + 1
2h - 1
2^h
What is the worst-case time complexity for inserting a node into a Red-Black Tree?
O(1)
O(log n)
O(n)
O(n log n)
When constructing a Segment Tree for a given array, what information is typically stored in each node of the Segment Tree?
The sum of all elements in the corresponding subarray of the original array.
The minimum value within the corresponding subarray of the original array.
A statistical measure (like mean or median) of the corresponding subarray.
It depends on the specific application and the type of queries the Segment Tree is designed to handle.
If a Perfect Binary Tree has 15 nodes, what is its height?
3
4
7
15
Consider a Binary Search Tree (BST). What is the time complexity of finding the LCA of two nodes in the BEST-CASE scenario?
In Huffman coding, what is the primary factor that determines the length of the codeword assigned to a character?
ASCII value of the character
Position of the character in the input text
Lexicographical order of the character
Frequency of occurrence of the character
What type of tree rotation is required to rebalance the following AVL tree after inserting the value '1'? (Assume standard AVL tree properties) 4 / 2 5 / 1
Right-Left Rotation
Left Rotation
Right Rotation
Left-Right Rotation
What is the time complexity of the most efficient algorithm to convert a sorted array to a balanced Binary Search Tree?
You need to serialize a binary tree into a string representation. Which method is generally considered MORE space-efficient for trees with many nodes having only one child?
Postorder Traversal with null markers
Preorder Traversal with null markers ('N' for null nodes)
Inorder Traversal with null markers
Level Order Traversal with null markers
What is the primary advantage of using a Complete Binary Tree for implementing a Heap data structure?
It guarantees a balanced tree, ensuring O(log n) operations.
It allows for efficient searching of elements in O(1) time.
It minimizes the space used for storing the tree.
It simplifies the process of tree rotations.