How can you identify leaf nodes during a preorder traversal of a binary tree?
A node is a leaf if its value is less than its parent's value.
A node is a leaf if both its left and right child pointers are NULL.
It is not possible to identify leaf nodes during preorder traversal.
A node is a leaf if it is visited before its children.
What is the time complexity of calculating the height of a binary tree?
O(n^2)
O(1)
O(n)
O(log n)
Which of the following is a common application of Binary Tree serialization?
Sorting data
Implementing a hash table
Storing and retrieving trees in a file or database
Finding the shortest path in a graph
What is the height of a perfect binary tree with 'n' nodes?
log2(n + 1) - 1
n/2
n - 1
log2(n)
What is the worst-case time complexity of inserting a node into a Binary Search Tree (BST)?
O(n log n)
What is the output of Preorder Traversal for the following Binary Tree: 1(2(4,5),3)?
4 5 2 3 1
4 2 5 1 3
1 3 2 4 5
1 2 4 5 3
What is the space complexity of finding the LCA in a Binary Tree using a recursive approach?
Is it possible for a full binary tree to have an even number of nodes?
Yes
No
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 node's immediate parent
The rightmost child of the node's left subtree
Any leaf node in the subtree rooted at the node being deleted
Which type of binary tree has the strictest structure, requiring all levels to be completely filled and all leaf nodes to be at the same level?
Balanced Binary Tree
Full Binary Tree
Perfect Binary Tree
Complete Binary Tree