filmov
tv
Unique Binary Search Trees II | Python DFS Solution

Показать описание
Time Complexity: O(C(N)) - where C(N) is the Catalan number - number of possible unique BSTs for n nodes
Space Complexity: O(logN) - Recursive stack depth is the tree height
Space Complexity: O(logN) - Recursive stack depth is the tree height