time complexity told in video is O(n) where n is number of nodes. Please explain how?
Complexity of count node function
@mayankA47 The complexity of binary tree traversal is O(n) since we are visiting all n nodes once. Here in this question, we are just traversing the tree and performing the operations. So it will take linear time.