Basically i have a binary tree which im setting up at the moment like this
I wanna do this differently so that the tree is more dynamic. The only way i can think of doing it is having these commands in a text file and then updating it when some one wants to add another node... Is this possible?
- you'll have to decide on a format for the text file. this format must: * express what a "node" is * express which node is "parent" and which is "child" * most likely express which child is "left" and which is "right" - after that, you'll have to write code to read this text file, decode it, and construct your tree accordingly.
sounds like a fun little exercise, actually. if you choose to do it, keep us updated on how it goes, and we'll be happy to help you out with any problems that might pop up.