0 votes 0 votes https://gateoverflow.in/2073/gate2014-3-39 https://gateoverflow.in/18749/tifr2010-b-26 @Arjun SIR WE ARE TAKING O(M) IN FIRST CASE (QUESTION IN 2014) BUT WHY LOG(N) IN TIFR QUESTION WHICH ONE IS CORRECt eyeamgj asked Sep 16, 2018 • edited Sep 16, 2018 by eyeamgj eyeamgj 848 views answer comment Share Follow See all 11 Comments See all 11 11 Comments reply Show 8 previous comments akash.dinkar12 commented Sep 16, 2018 reply Follow Share printing the values of nodes is like running traversal methods(In order, preorder etc) which are O(n ) algorithm... 0 votes 0 votes Shaik Masthan commented Sep 16, 2018 reply Follow Share if there are n elements in a binary tree, what's the time complexity to print all those values? with in O(n), we can print them sir. i understood why you gave this statement sir. While checking for L or H, i will cut the no need part of the tree. then it is a Binary tree with m (which are required) nodes ==> O(m) right sir? 0 votes 0 votes Arjun commented Sep 16, 2018 reply Follow Share Yes 0 votes 0 votes Please log in or register to add a comment.