Thread: LevelOrder() Tranverse

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    84

    LevelOrder() Tranverse

    I am looking for any information on the LevelOrder Tranverse. Can anyone help me out on that?

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    101
    1. Push the head on a queue.
    2. Pop the queue and push the children of the popped node on the queue.
    3. Process the popped node (ie. show it on the screen).
    4. Go back to 2 until there are no more nodes in the queue.
    - lmov

  3. #3
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    That's also called breadth first traversal right?
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

Popular pages Recent additions subscribe to a feed