how 'if', and not 'while',?!

Dark Mode

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

1 vote