Which data structure is used in the iterative implementation of Preorder Traversal?
Stack
Linked List
Heap
Queue
What is the relationship between the depth of a node and its index in an array-based representation of a complete Binary Tree?
Depth = Index / 2
Depth = 2 * Index
Depth = Index
Depth = log2(Index + 1)
What is the worst-case time complexity of inserting a node into a Binary Search Tree (BST)?
O(log n)
O(n log n)
O(1)
O(n)
What is the time complexity of calculating the height of a binary tree?
O(n^2)
Perfect binary trees are commonly used in which of the following applications due to their balanced structure and efficient space utilization?
Heap Sort
Trie Data Structures
Binary Search Trees
Hash Tables
Which of the following statements is true about AVL trees?
AVL trees guarantee a maximum height difference of 1 between the left and right subtrees of any node.
AVL trees do not require any rotations to maintain balance.
AVL trees are a type of Red-Black tree.
AVL trees are always perfectly balanced.
What is the relationship between the number of leaf nodes (L) and the number of internal nodes (I) in a full binary tree?
L = I
L = I + 1
L = I - 1
L = 2 * I
What is the primary advantage of using an iterative approach (with a stack) over recursion for Inorder Traversal?
Iterative traversal is generally faster.
There is no significant advantage; both approaches have similar performance.
Iterative traversal is easier to understand and implement.
Iterative traversal avoids function call overhead and potential stack overflow for very deep trees.
What is the time complexity of finding the LCA in a Binary Search Tree (BST) in the worst case?
Why are two stacks often used in the iterative implementation of Postorder Traversal?
One stack is used for the left subtree traversal, and the other for the right subtree traversal.
One stack stores the nodes to be visited, and the other stores the visited nodes.
One stack stores the nodes in preorder, and the other stores them in inorder, allowing us to derive the postorder.
Two stacks are not strictly required; one stack is sufficient for iterative Postorder Traversal.