0 0 votes Consider the following algorithm: ORDER (T) begin if (T!=NULL) then begin ORDER (LPTR(T)) PRINT (DATA(T)) ORDER (RPTR(T)) end return end where LPTR: left pointer RPTR: right pointer T: given tree This above algorithm is used to: Traverse the tree in preorder in a recursive manner Traverse the tree in in-order, in a recursive manner Traverse the tree in post-order in a recursive manner Do not Traverse the tree at all GATE tbb-mockgate-1 data-structures tree + – Bikram 1.0k views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
Best answer 1 1 vote It's a recursive code for inorder traversal. nandini gupta answered Jan 17, 2017 • selected Feb 7, 2017 by Bikram nandini gupta comment Share Follow See all 2 Comments 2 2 Comments reply Nit9 commented Feb 5, 2017 reply Follow flag how 'if', and not 'while',?! 0 0 replyShare Bikram commented Feb 5, 2017 reply Follow flag @Nitin Sharma here T is the Tree, it may be NULL, thats why there is " if " . "while" means we assume Tree T never gonna be NULL, which is not the default case ! By default Tree T is NULL , we assume. 0 0 replyShare Please log in or register to add a comment.