Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
Cinjection
Oleksi Derkatch
Send A Message
Rating
Not
Rated
Please login to rate source codes.

Click here to register a free account with us.
General Details
Scheme
Posted 97 Days Ago
201 Views
Received 0 Ratings
More Codes By This Author
MD5 Brute-Forcer
Number of ways to make ch...
SPS Desktop Changer
Simple program using GUI...
Genetic Algorithm for sol...
Articles By This Author
Intorduction to memoizati...
Strings in C++
Vectors in C++
Use Cases
[C++] Pointers and their...

Depth-first and Breadth-first Tree Traversal


Description
Below are two types of tree traversal, depth-first and breadth-first. Note that I named the breadth-first algorithm dragon-search, because it reminds me of a dragons breath. :P (I have weird ways of remembering things.)

Anyway, please leave your comments on how I can improve this code. Thanks in advance.
Source Code
Comments
Please login to post comments.
 
Cinjection     Posted 96 Days Ago
 
 
Thanks. I'll experiment with that. I think that I'm getting the hang of
Scheme. I just need to practice a lot more. At least the functional paradigm
isn't a mind bending mystery anymore :).
 
closure     Posted 97 Days Ago
 
 
Hi,
this looks very good. Maybe you want to think about a way to generalize
the procedures. So that the action that is performed on each node can be user
supplied and maybe you even want to try to encapsulate the search-strategy into
another procedure.
So that you get a generalized search algorithm that works on trees.
Sth like this maybe: (search breadth-first display) or (search depth-first display)
and later (search best-first display) or even (search (best-first A*) display) ;)

Keep up the good work
Page 1 of 1
More "Scheme" Source Codes By This Author
Recently Posted "Scheme" Source Codes
Recently Rated "Scheme" Source Codes
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved