Grokking the Coding Interview: Patterns for Coding Questions
0% completed
Solution: Binary Search Tree Iterator
.....
.....
.....
Like the course? Get enrolled and start learning!
A
Anonymous
· 2 years ago
Even though we have a separate thread for processing traverseLeft for right subtree in next() function, it actually is still synchronous because it first checks if all threads have been processed by calling checkThread and then only creates a new thread.
A
Anonymous
· 2 years ago
We need to add a customized constructor to accept TreeNode of root in the given code sample.
public Solution(TreeNode root) { initialize(root); }
Reading Progress
0%