Thread: Binary Taxonomy Tree

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    42

    Binary Taxonomy Tree

    I am writing a binary taxonomy tree program that reads from an file and reconstruct the tree. The program will learn from the users and expand the tree.
    The requirement is each node must contain an 'index' or 'key' value to be used for reconstructing the tree from the input file, using the BINARY SEARCH TREE method of insertion.

    The question is how can I use 'index' to determine where the parents and children should go in the tree? If I use number, do I just pick a number randomly and assign to each node? Thanks in advance.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >> each node must contain an 'index' or 'key' value ... using binary search ... insertion

    Looks like the index/key value simply describes the 'order' for each node - so they can be sorted. So just think of it as a tree of key values (integers).

    gg

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Actually, I think it's a taxonomy tree, where keys are used to identify the species (or genus) of some living thing (plants, fungus, fauna - I think there's one or two further groups).

    It's essentially a "yes/no" tree where each point leads closer to a defined species (or genus, or family).

    When these trees are generated manually, the keys are usually just generated as numbers.

    The trouble with forming the tree is to place new keys in teh right place, because the differentiating factor may not be best placed at the point where the tree "ends", but further up. In the case of an educated user, it may actually be OK to ask "where do you want to insert this key", and list the steps to get to the current point.

    Of course, I could have misunderstood the question, in which case I suggest everyone ignore my blabberings.

    --
    Mats

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 11-04-2006, 11:07 AM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. Tutorial review
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 03-22-2004, 09:40 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. BST/Red and Black Tree
    By ghettoman in forum C++ Programming
    Replies: 0
    Last Post: 10-24-2001, 10:45 PM