6 votes 6 votes A program takes as input a binary tree (not necessarily balanced) with $n$ nodes and computes for each node, the no. of leaf nodes in the sub-tree rooted at that node. The worst case time complexity of the program is $\Theta(n)$ $\Theta(n \log n)$ $\Theta\left(n^2 \right)$ $\Theta\left(n^2 \log n \right)$ DS go-ds-1 data-structures binary-tree + – Arjun asked Oct 10, 2016 Arjun 1.2k views answer comment Share Follow See 1 comment See all 1 1 comment reply Sheshang commented Dec 19, 2016 reply Follow Share plz explain someone 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes What would be the answer if, we are asked to compute number of nodes in the subtree rooted at each node of the binary tree? Animesh Sinha answered Jun 10, 2020 Animesh Sinha comment Share Follow See all 0 reply Please log in or register to add a comment.