what will be the space and time complexity of right view code?
Space and time complexity?
hello @namangarg31
time complexity -> O(n) because we r traversing the complete tree
space complexity -> O(h) where h is the height of the tree.
what will be the space and time complexity of right view code?
hello @namangarg31
time complexity -> O(n) because we r traversing the complete tree
space complexity -> O(h) where h is the height of the tree.