 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Binary Tree Data Structure
| [MUG] Binary Tree Data Structure |
|
Author: Bruno Guerrieri
Posted: Mon, 3 Feb 2003 17:52:58 -0500
|
>> From: "Bruno Guerrieri" "bruno.guerrieri"
Dear MUG
I am trying to use Maple to set up binary trees and work with them. Is =
there a person in the community who has already written the standard =
procedures for insertion, deletion of nodes etc.. and would not mind =
sharing?
In addition, although I do not want to go the route of C, C++, etc, the =
concept of pointer is especially useful when dealing with trees. Since =
speed is not paramount to what I am doing, is there a "construct", (be =
it artificial and to be refined in future versions), a definition-like =
"thing" that someone could set up at the beginning of the worksheet that =
would allow one to almost translate word for word certain C procedures =
such as node deletion in a tree, exploiting the recursive nature of the =
situation.=20
The construct would, of course, be the equivalent of the pointer concept =
p->left or p->right as one can see in the following example:
Here is an example of a C procedure
void printtree(node *p)
{ if (p !=3D NULL)
{ printtree(p->left);
printf(........,p->count, p->pword);
printtree(p->right);
}
}
I tried the network package to plot some binary trees and that was like =
to trying to ride a wild bronco.
Sincerely,
Bruno Guerrieri
|
Previous by date: [MUG] maple printing question, Clearthink
Next by date: [MUG] FuzzySets package, Douglas Wilhelm Harder
Previous thread: [MUG] How to control colors in plot3d (option shading), Erik Leunissen
Next thread: [MUG] FuzzySets package, Douglas Wilhelm Harder
|
|
|