What is the difference between the height and depth of a node in a binary tree?
Height is the number of edges from the node to the deepest leaf, while depth is the number of edges from the root to the node.
Height is always one more than the depth of a node.
Height is the number of edges from the root to the node, while depth is the number of nodes from the root to the node.
Height and depth are the same thing.
Which traversal algorithm is most suitable for finding the Lowest Common Ancestor (LCA) of two nodes in a Binary Tree?
Any of the above
Level Order Traversal
Postorder Traversal
Preorder Traversal
Which of the following statements is true about AVL trees?
AVL trees are always perfectly balanced.
AVL trees are a type of Red-Black tree.
AVL trees do not require any rotations to maintain balance.
AVL trees guarantee a maximum height difference of 1 between the left and right subtrees of any node.
Level Order Traversal of a Binary Tree is also known as?
Breadth First Search (BFS)
Depth First Search (DFS)
Which data structure is used in the iterative implementation of Preorder Traversal?
Linked List
Heap
Stack
Queue
Which type of binary tree traversal is typically used to delete all nodes in a BST?
Inorder traversal
Preorder traversal
Level-order traversal
Postorder traversal
Inorder Traversal is particularly useful for which of the following applications?
Finding the height of a Binary Tree.
Finding the diameter of a Binary Tree.
Checking if a Binary Tree is balanced.
Printing the nodes of a BST in sorted order.
What is the time complexity of finding the LCA in a Binary Search Tree (BST) in the worst case?
O(log n)
O(n)
O(n log n)
O(1)
What is the time complexity of finding all root-to-leaf paths in a Binary Tree?
O(n^2)
What is the relationship between the depth of a node and its index in an array-based representation of a complete Binary Tree?
Depth = 2 * Index
Depth = Index / 2
Depth = log2(Index + 1)
Depth = Index