Which type of binary tree traversal is typically used to delete all nodes in a BST?
Level-order traversal
Inorder traversal
Postorder traversal
Preorder traversal
The diameter of a binary tree is defined as:
The number of nodes in the tree.
The height of the tree.
The shortest path between the root and any leaf node.
The longest path between any two nodes in the tree.
Which of the following is a common application of Binary Tree serialization?
Implementing a hash table
Sorting data
Storing and retrieving trees in a file or database
Finding the shortest path in a graph
What is the space complexity of finding the LCA in a Binary Tree using a recursive approach?
O(1)
O(log n)
O(n log n)
O(n)
If a perfect binary tree has a height of 'h', how many nodes are present in the tree?
2h
2^(h+1) - 1
2^h - 1
h^2
What is the time complexity of efficiently finding the diameter of a binary tree?
O(n^2)
What is the maximum number of nodes at level 'l' in a binary tree?
l
2l
2^l
l^2
Which of the following is NOT a typical application of Binary Search Trees?
Finding the median of a dataset
Storing and retrieving data in a specific order
Representing a graph data structure
Implementing sorted sets and maps
When deleting a node with two children in a BST, which node is typically chosen as its replacement?
The node's immediate parent
The rightmost child of the node's left subtree
The leftmost child of the node's right subtree
Any leaf node in the subtree rooted at the node being deleted
Preorder Traversal is often used as a step in which of the following tasks?
Checking if two Binary Trees are mirrors of each other.
Level order traversal of a Binary Tree.
Creating a deep copy of a Binary Tree.
Finding the Lowest Common Ancestor (LCA) of two nodes.