Tree Traversal 2

Following Tree Traversing Techniques can be used to print a Binary Search Tree (BST);

  • Preorder traversal (left) (right) root
  • Postorder traversal root (left) (right)
  • Inorder traversal (left) root (right)

Which of them can be used to print a Binary Search Tree (BST) in Descending Order ?


this problem is apart of this set
Inorder traversal Postorder traversal None of these Preorder traversal

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Zeeshan Ali
Dec 20, 2015

The traversal that can be used to print a tree in Descending order is; ( r i g h t ) r o o t ( l e f t ) (right) root (left) which is neither Pre-order nor Post-order nor In-order . Hence None of these is the right choice for the answer.

Following is the algorithm that can be followed to print a tree in Descending order;

print(T) starts
    if T is not NULL
        print(T->right);
        print T->data;
        print(T->left);
print(T) ends
  • Hope the solution be helpful to you all.
  • For further understanding please

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...