1 votes 1 votes Kevin is asked to write a single program to print the inorder, preorder, postorder and level order traversal of a binary tree having $n$ nodes. The best possible time complexity of this function is ___________ $\Theta(n^3)$ $\Theta(n)$ $\Theta(n^2)$$\Theta(n\log n)$ DS go2025-ds-1 stack + – gatecse asked Aug 9, 2020 gatecse 359 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes All the traversals can be done in $O(n)$ time. So, the total time complexity remains $O(n).$ gatecse answered Aug 9, 2020 • selected Aug 6, 2022 by Arjun gatecse comment Share Follow See all 0 reply Please log in or register to add a comment.