can anyone post the function to insert elements into a binary tree?[not binary search tree]
This is a discussion on binary tree within the C++ Programming forums, part of the General Programming Boards category; can anyone post the function to insert elements into a binary tree?[not binary search tree]...
can anyone post the function to insert elements into a binary tree?[not binary search tree]
It depends on what is the binary tree and how it was implemented.Originally Posted by vikasvijayan
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
can you give the general inserting procedure by using linkedlist?
There is no "general inserting procedure". For example, can you give the general inserting procedure for eating food? If you started with "pick up your fork and spoon", you're wrong, because I intend to use chopsticks for lunch. If you skip that part, you're wrong, because the tools are essential (even if only hands are used). Clearly, I should elaborate, e.g., on the kind of food, the environment, etc.Originally Posted by vikasvijayan
So, why don't you show your binary tree implementation thus far?
By the way, what's with the "not binary search tree" clause?
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way
i know the procedure for binary search tree...
I see. So what problem are you facing now? If you can insert into a binary search tree that is implemented using pointers as in a linked list, you should be able to insert into a binary tree that is implemented using pointers as in a linked list.Originally Posted by vikasvijayan
C + C++ Compiler: MinGW port of GCC
Version Control System: Bazaar
Look up a C++ Reference and learn How To Ask Questions The Smart Way