pre order sequence

figure shows a, b to left,c to right and d in middle of b and c with a

Page 1 of 1

1 Replies - 3731 Views - Last Post: 04 August 2008 - 02:27 PM

#1 donaldh   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 22-April 08

pre order sequence

Post icon  Posted 04 August 2008 - 12:58 PM

the preorder sequence is

I believe it s A B D C

can anyone confirm this

Thks
Is This A Good Question/Topic? 0
  • +

Replies To: pre order sequence

#2 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: pre order sequence

Posted 04 August 2008 - 02:27 PM

Could you please post your entire question inside the post and try to make it clearer.

preorder generally refers to the way one may traverse a tree, so for example if you have the tree:

........A........
....B.......C...
..D..E...F...G

Than the pre-order traversal would be A B D E C F G

1. Visit the root first
2. Traverse the left subtree
3. Traverse the right subtree.

If i had a pre-order traversal of ABDC than would would have a tree like:

........A........
....B.......C...
..D..............
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1