![]() |
| | #1 |
| Registered User Join Date: Nov 2009
Posts: 3
| |
| vanilla is offline | |
| | #2 |
| Algorithm Dissector Join Date: Dec 2005 Location: New Zealand
Posts: 2,476
| No, we don't do homework for you. You do it and we help you fix bugs.
__________________ My homepage Advice: Take only as directed - If symptoms persist, please see your debugger |
| iMalc is offline | |
| | #3 |
| Registered User Join Date: Jan 2008 Location: Seattle
Posts: 476
| What type of "generic" tree are you needing to convert? How are you nodes connected? Is this a disjointed tree perhaps? Your question is so open ended one can go in any direction with that line of questioning. |
| slingerland3g is offline | |
| | #4 |
| Registered User Join Date: Nov 2009
Posts: 3
| I am really new to C programming! My general tree has got one parent, 4 children and 6 grand children.How can i convert this into a binary tree? pls ! tell me the algorithm to do this conversion programming (in "C").I will try to do the programming stuff. |
| vanilla is offline | |
| | #5 | |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,139
| Quote:
Or, if you have to do it in-place. Select the correct tree traversal algorithm (you decide which that is), and relink the (hint: bottom) nodes that have already been traversed, building the binary tree as you go. Neither of which is overly hard to do if you understand trees. Or, if order and balance doesn't matter (you said binary tree, not binary search tree) then you can simply traverse and relink. Last edited by zacs7; 11-04-2009 at 05:05 AM. | |
| zacs7 is offline | |
| | #6 |
| Registered User Join Date: Nov 2009
Posts: 3
| Thanx for your clarification. |
| vanilla is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dec to Binary code | 4dice | C Programming | 7 | 01-12-2009 03:40 PM |
| Source code in on machine A, binary is on machine B, is there a way for GDB to refer | meili100 | C++ Programming | 4 | 01-18-2008 07:05 PM |
| Trouble reading a binary file as float values - I need the EXPERTs' HELP in C++ code! | top_handasa | C++ Programming | 8 | 03-26-2007 05:48 PM |
| Obfuscated Code Contest | Stack Overflow | Contests Board | 51 | 01-21-2005 04:17 PM |
| What is binary code? | DramaKing | A Brief History of Cprogramming.com | 11 | 12-04-2001 11:46 AM |