DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006

    Exclamation Tree Traversal Questions

    According to the tree at http://www.geocities.com/beamer7296/images/tree.JPG, can someone please check my traversals below to see if thry're all correct!?! I'd really appreciate it!

    Level-order traversal - A, B, D, E, F, H, J, K, M, Q, R, S, T, U, C, W, X, Y
    Preorder traversal - A, B, E, K, X, T, Y, U, M, F, D, H, Q, C, W, J, R, S
    Postorder traversal - K, X, T, Y, U, M, E, F, B, C, W, Q, H, R, S, J, D, A
    Inorder traversal - K, E, M, T, X, U, Y, B, F, A, D, H, Q, C, W, J, R, S

  2. #2
    Join Date
    Dec 2004
    San Bernardino County, California
    I think that the orders would go as follows:

    preorder - you "print" when you first hit the node
    A, B, E, K, M, T, X, U, Y, F, D, H, Q, C, W, J, R, S

    inorder - you "print" after the traversal returns from a visit down the sub-tree rooted by your left child, before you traverse down the subtree rooted by your right child
    K, E, T, X, M, Y, U, F, C, Q, W, H, D, R, J, S

    postorder - you "print" after return from both children
    K, X, T, Y, U, M, E, F, B, C, W, Q, H, R, S, J, D, A

Similar Threads

  1. Replies: 0
    Last Post: 02-21-2006, 08:47 PM
  2. Changing targets in XML Tree
    By jdnyc in forum XML
    Replies: 0
    Last Post: 11-07-2005, 02:48 AM
  3. Dynamic tree view control
    By anbaz in forum ASP.NET
    Replies: 2
    Last Post: 06-15-2005, 09:09 PM
  4. Tree View Control Questions
    By John G. in forum .NET
    Replies: 3
    Last Post: 03-04-2002, 07:27 AM
  5. Replies: 2
    Last Post: 01-15-2001, 11:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.