-
print a binary tree level by level
Could someone help me out in printing a binary tree level by level, knowing its depth??
-
You would perform a breadth first search -
go to root, put it into a queue
whle the queue is not empty,
pop the root node off the queue, print, visit each of its children, pushing them onto the queue
pop the first child off the queue, print, visit each of its chidren, pushing them onto the queue
pop the next child,
etc.
Similar Threads
-
By oranged in forum VB Classic
Replies: 2
Last Post: 07-19-2006, 06:50 AM
-
Replies: 2
Last Post: 04-18-2006, 05:12 PM
-
Replies: 4
Last Post: 12-05-2005, 06:58 PM
-
By TheJVM_1970 in forum Java
Replies: 2
Last Post: 12-05-2005, 12:23 AM
-
Replies: 2
Last Post: 03-24-2000, 01:05 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|