DIY: Binary Search Tree Iterator

We'll cover the following

Problem statement

In this challenge, you have to implement a binary search tree iterator class called BSTIterator. The iterator will be initialized by the root node of the BST. You have to implement two methods:

  • next(): This will return the next smallest number in the BST.
...

Create a free account to view this lesson.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Devpath's Terms of Service and Privacy Policy