A complete binary tree with 'n' nodes has a height of?
floor(log2(n))
n - 1
n/2
log2(n) + 1
Which type of binary tree traversal is typically used to delete all nodes in a BST?
Inorder traversal
Level-order traversal
Postorder traversal
Preorder traversal
When deleting a node with two children in a BST, which node is typically chosen as its replacement?
The leftmost child of the node's right subtree
The rightmost child of the node's left subtree
The node's immediate parent
Any leaf node in the subtree rooted at the node being deleted
What is the worst-case time complexity of inserting a node into a Binary Search Tree (BST)?
O(n)
O(log n)
O(n log n)
O(1)
What is the output of Preorder Traversal for the following Binary Tree: 1(2(4,5),3)?
4 5 2 3 1
1 3 2 4 5
1 2 4 5 3
4 2 5 1 3
Level Order Traversal of a Binary Tree is also known as?
Preorder Traversal
Breadth First Search (BFS)
Postorder Traversal
Depth First Search (DFS)
Which data structure is most suitable for efficiently finding a path with a given sum in a Binary Tree?
Heap
Stack
Hash Set
Queue
What is the primary advantage of using an iterative approach (with a stack) over recursion for Inorder Traversal?
There is no significant advantage; both approaches have similar performance.
Iterative traversal is generally faster.
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 maximum number of nodes at level 'l' in a binary tree?
l^2
l
2^l
2l
A full binary tree with 'k' internal nodes has how many total nodes?
k + 1
k
2k
2k + 1