Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. tarverse binary tree

tarverse binary tree

Scheduled Pinned Locked Moved Algorithms
data-structuresquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abu rakan
    wrote on last edited by
    #1

    I have binary tree And I want to traverse this tree level by level that's mean print the level zero then level one ....etc how can I do that

    M A R 3 Replies Last reply
    0
    • A abu rakan

      I have binary tree And I want to traverse this tree level by level that's mean print the level zero then level one ....etc how can I do that

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      where you get the binary tree from? as far as i know there is not one included in .Net framework (or whatever your using)(I may be wrong). But basically you would need to know how it works before you can move through it. If you made your own then you should know this answer.

      A 1 Reply Last reply
      0
      • A abu rakan

        I have binary tree And I want to traverse this tree level by level that's mean print the level zero then level one ....etc how can I do that

        A Offline
        A Offline
        Alan Balkany
        wrote on last edited by
        #3

        Use a breadth-first search: http://en.wikipedia.org/wiki/Breadth-first_search[^]

        1 Reply Last reply
        0
        • M musefan

          where you get the binary tree from? as far as i know there is not one included in .Net framework (or whatever your using)(I may be wrong). But basically you would need to know how it works before you can move through it. If you made your own then you should know this answer.

          A Offline
          A Offline
          abu rakan
          wrote on last edited by
          #4

          thanks so much I am study data structure specially non linear data structure and I need algorithm to solve my problem I know about BFS but I think this used in graph only my be my teacher Will Not accept this BFS in binary tree thanks another time

          A 1 Reply Last reply
          0
          • A abu rakan

            thanks so much I am study data structure specially non linear data structure and I need algorithm to solve my problem I know about BFS but I think this used in graph only my be my teacher Will Not accept this BFS in binary tree thanks another time

            A Offline
            A Offline
            Alan Balkany
            wrote on last edited by
            #5

            A binary tree IS a graph. You can use a BFS quite easily on a binary tree.

            1 Reply Last reply
            0
            • A abu rakan

              I have binary tree And I want to traverse this tree level by level that's mean print the level zero then level one ....etc how can I do that

              R Offline
              R Offline
              richardw48
              wrote on last edited by
              #6

              You need to find out about 'recursion' techniques

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups