retagged by
367 views
0 votes
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:

  1.   Traverse the tree in preorder in a recursive manner
  2.   Traverse the tree in in-order, in a recursive manner
  3.   Traverse the tree in post-order in a recursive manner
  4.    Do not Traverse the tree at all
retagged by

1 Answer

Best answer
1 votes
1 votes
It's a recursive code for inorder traversal.
selected by
Answer:

Related questions

4 votes
4 votes
2 answers
2
Bikram asked Jan 16, 2017
864 views
Hash a list of $3$ keys into hash table with $20$ locations. What will be the probability of the event $A$ in which hashing the three keys causes a collision?$0.123$$0.14...
1 votes
1 votes
2 answers
3
Bikram asked Feb 9, 2017
293 views
A ternary tree is a tree in which every internal node has exactly three children.The number of leaves in a ternary tree with $’z’$ internal nodes is _______.$2$$\left...
0 votes
0 votes
1 answer
4