Data Structures & AlgorithmsEasyTCS NQT · Infosys pattern

Which traversal of a binary search tree visits the keys in ascending order?

  1. A. Inorder
  2. B. Preorder
  3. C. Level order
  4. D. Postorder

Correct answer: A. Inorder

Inorder visits left subtree, root, right subtree; in a BST everything on the left is smaller and everything on the right larger, so the keys come out sorted.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic