Algorithms and Data Structures · Middle · Question 36 of 75

Which tree traversal visits the values of a BST in sorted order?

Explanation

In-order visits everything smaller than a node before it and everything larger after it. Pre-order is handy for copying a tree, post-order for deleting it or evaluating expressions.

Further reading

Problem with a question

Algorithms and Data Structures · Middle · question 36

Test yourself

Take the Algorithms and Data Structures · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz