Solution Review: Checking the BST property
This lesson contains the solution review for Checking the BST property challenge.
We'll cover the following...
We'll cover the following...
Recall the in-order traversal that we learned in the Binary Trees chapter. The in-order traversal of a Binary Search Tree gives us the list of nodes in sorted order.
In the code widget below, we have implemented the in-order traversal for BST and you can confirm the traversal in the illustration above.
We have discussed in-order traversal above because we’ll be using a similar idea to check whether a tree satisfies the BST property or not. If we traverse a binary tree in-order and it results in a sorted list, then the tree satisfies the BST property.