![]() |
| | #1 |
| Guest
Posts: n/a
| |
| | #2 |
| and the hat of vanishing Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,214
| > I want to know where do I begin. At the root of the tree > Do I need to count the height of the tree or what That would depend on how you choose to represent the tree when you've printed it. If its just a text dump, no formatting is required But if it's a nice graphical thing, then more work is required.
__________________ If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. Up to 8Mb PlusNet broadband from only £5.99 a month! |
| Salem is offline |
| | #3 |
| Guest
Posts: n/a
| I want a graphically output: example: 100 50 40 25 30 12 ......and such |
| | #4 |
| Guest
Posts: n/a
| that didnt come out right....cuz I guess this forum doesnt display the spaces. I want a graphically tree with the corresponding numbers. |
| | #5 |
| Guest
Posts: n/a
| i still need some help???what this printing of a tree structure..... |
| | #6 |
| Registered User Join Date: Sep 2001
Posts: 752
| Still not too sure what your asking, but here goes... 1) The generic treeprinting program Code: void printtree(node * tree)
{
if (tree != NULL)
{
print (tree -> info); // Not a real command
printtree (tree -> left);
printtree (tree -> right);
}
}
__________________ Callou collei we'll code the way Of prime numbers and pings! |
| QuestionC is offline |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| determine if tree is strictly binary bst | ashir30000 | C++ Programming | 1 | 05-20-2009 02:27 AM |
| Binary Search Tree - one last question | tms43 | C++ Programming | 2 | 11-14-2006 03:58 AM |
| Binary Search Trees Part III | Prelude | A Brief History of Cprogramming.com | 16 | 10-02-2004 03:00 PM |
| Tutorial review | Prelude | A Brief History of Cprogramming.com | 11 | 03-22-2004 09:40 PM |
| Binary Tree Search | C++Newbie | C++ Programming | 5 | 03-22-2002 12:38 PM |