0 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 Data Structures + – eyeamgj 1.8k views answer comment Share Follow Print See all 11 Comments 11 11 Comments reply Show 8 previous comments akash.dinkar12 commented Sep 16, 2018 reply Follow flag printing the values of nodes is like running traversal methods(In order, preorder etc) which are O(n ) algorithm... 0 0 replyShare Shaik Masthan commented Sep 16, 2018 reply Follow flag 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 0 replyShare Arjun commented Sep 16, 2018 reply Follow flag Yes 0 0 replyShare Please log in or register to add a comment.