space complexity = depth * memory consumed. I have depth log(n) so in space complexity is O(NlogN). In one medium blog it says O(N). Therefore which is right?
cla