educative.io

Space complexity of Validate Binary Search Tree

The stated space complexity of the solution is O(n). If the only space used is for the recursive stack, then should we express this more efficiently as O(h), where h is the height of the tree?


Course: Grokking Coding Interview Patterns in Python - AI-Powered Learning for Developers
Lesson: https://www.educative.io/courses/grokking-coding-interview-patterns-python/solution-validate-binary-search-tree