binary 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]...

  1. #1
    Registered User
    Join Date
    Oct 2011
    Location
    india
    Posts
    18

    binary tree

    can anyone post the function to insert elements into a binary tree?[not binary search tree]

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,588
    Quote Originally Posted by vikasvijayan
    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.
    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

  3. #3
    Registered User
    Join Date
    Oct 2011
    Location
    india
    Posts
    18
    can you give the general inserting procedure by using linkedlist?

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,588
    Quote Originally Posted by vikasvijayan
    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.

    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

  5. #5
    Registered User
    Join Date
    Oct 2011
    Location
    india
    Posts
    18
    i know the procedure for binary search tree...

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,588
    Quote Originally Posted by vikasvijayan
    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.
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Converting From Binary Tree to Threaded Binary Trees
    By elton_fan in forum C Programming
    Replies: 15
    Last Post: 11-08-2007, 10:41 PM
  2. Replies: 2
    Last Post: 08-01-2007, 01:08 PM
  3. Replies: 0
    Last Post: 11-04-2006, 10:07 AM
  4. display tree data in binary tree format
    By xddxogm3 in forum C++ Programming
    Replies: 4
    Last Post: 12-10-2003, 11:47 PM
  5. b-tree (not binary tree) implementation help
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 01-02-2002, 02:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21