LeetCode-Swift icon indicating copy to clipboard operation
LeetCode-Swift copied to clipboard

Space complexity of solution to Maximum Depth Of Binary Tree

Open snapfinger opened this issue 5 years ago • 1 comments

The space complexity was specified as O(1) in the solution, however because of recursion, considering the stack, should it be O(n) instead?

snapfinger avatar Jul 05 '20 18:07 snapfinger

@snapfinger Yes you are correct. Space complexity of the solution should be O(n). @soapyigu Should I raise the PR to fix this?

KartikSatoskar avatar Oct 21 '20 09:10 KartikSatoskar