Question

Which of the following techniques is most efficient for finding the kth smallest element in a Binary Search Tree (BS

  • T ?
A Perform an Inorder Traversal and index the kth element.
B Use a Breadth-First Search (BFS) and store all nodes in a queue.
C Convert the BST to an array and sort it.
D Use a Min-Heap to extract the kth smallest element.
E Recursively traverse the left and right subtrees while keeping a counter.
Practice Next

Hey! Ask a query