|
General Details
|
|
Scheme
|
|
Posted 333 Days Ago
|
|
272 Views
|
|
Received 1 Rating
|
|
down the tree
Description
This piece of code was made when i helped a friend of mine in his university class on datastructures.
It's a very simple imlementation of binary-trees in scheme. The task was the following:
given tow lists holding the nodes from an inorder and and a preorder traversal of an unknown
tree, the code shall be able to construct this unknown tree from the lists given.
That's what (from-in-pre-order) does.
Additionally the code provides a generic procedure (traverse-tree) that is to be passed a tree
and a procedure implementing the order of traversal. There is pre,post and inorder predefined
as such a procedure.
That's all there is to it. I bet the code can be improved, feel free to do so :)
Technical
You need a working scheme-interpreter
Source Code
Comments
| Please login to post comments. |
|
|
Hi cinjection,
srfi-1 is the first of the scheme requests for implementions. Those are basically libraries.
This particular library provides list-procedures. See: http://srfi.schemers.org/
|
|
|
Good stuff. I made something similar in Scheme as well.
What is (use srfi-1)? I've seen it all you Scheme code.
|
|
|
wow... I can't understand it.... it's... totally unfamiliar... looks cool though :)
|
More "Scheme" Source Codes By This Author
Recently Posted "Scheme" Source Codes
Recently Rated "Scheme" Source Codes
|