In search of a good example.

Discussion in 'C++' started by codefixer@gmail.com, Mar 10, 2005.

  1. Guest

    Hi,

    I am supposed to recommend a project using Binary Tress. I don't want
    to use the same old school examples. I am wondering if anyone of you
    can think of a real world example which uses Binary Tress. Need to be a
    complex one.

    Thanks
    , Mar 10, 2005
    #1
    1. Advertising

  2. wrote:

    > Hi,
    >
    > I am supposed to recommend a project using Binary Tress. I don't want
    > to use the same old school examples. I am wondering if anyone of you
    > can think of a real world example which uses Binary Tress. Need to be a
    > complex one.
    >
    > Thanks
    >


    Database index file / table.
    Given a key field of a record, locate the record as quickly
    as possible. One could use a "Binary Tress" to associate
    the key with the position of a record.

    I don't know if this is a school example or not.

    Hmm, is a binary truss the same as a binary tress?

    --
    Thomas Matthews
    Thomas Matthews, Mar 10, 2005
    #2
    1. Advertising

  3. <> wrote in message
    news:...

    > I am supposed to recommend a project using Binary Tress.


    How about the animal game?

    Here's how it works: The machine asks you to think of an animal, and then
    starts asking you yes/no questions about it. Eventually, it makes a guess
    as to what the animal is, and you tell it whether it's right.

    If it's wrong, it asks you: What question would you ask to distinguish your
    animal from <whatever its guess was>?

    You ask it a question, and tell it whether the answer should be yes or no.
    After that, it will incorporate your question into the list of questions
    that it asks next time.

    It should be clear that the data structure to use for this game is a binary
    tree, with a new leaf added each time there's a new animal.
    Andrew Koenig, Mar 10, 2005
    #3
  4. > I am supposed to recommend a project using Binary Tress. I don't want
    > to use the same old school examples. I am wondering if anyone of you
    > can think of a real world example which uses Binary Tress. Need to be a
    > complex one.



    An implementation of std::map?

    cheers,
    Marcin
    Marcin Kalicinski, Mar 11, 2005
    #4
  5. <> wrote in message
    news:...
    > Hi,
    >
    > I am supposed to recommend a project using Binary Tress. I don't want
    > to use the same old school examples. I am wondering if anyone of you
    > can think of a real world example which uses Binary Tress. Need to be a
    > complex one.
    >
    > Thanks


    A compression tree is pretty complex, but the tree starts balanced and ends
    up pretty lopsided.

    It only takes a small while to code, but longer to think out.

    Dan
    DHOLLINGSWORTH2, Mar 11, 2005
    #5
  6. Alan Brown Guest

    wrote in
    news::

    > Hi,
    >
    > I am supposed to recommend a project using Binary Tress. I don't want
    > to use the same old school examples. I am wondering if anyone of you
    > can think of a real world example which uses Binary Tress. Need to be a
    > complex one.
    >
    > Thanks
    >


    How about counting the words in a text.

    Each word occupies a tree node with a counter. The counter is incremented
    for each repetition of the word.

    At the end an alphabetic list of words and counters is printed.

    Maybe this is too simple :(

    Alan
    Alan Brown, Mar 11, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    3
    Views:
    3,214
    Steven Cheng[MSFT]
    Feb 3, 2004
  2. Replies:
    1
    Views:
    4,224
    Oliver Wong
    Jan 23, 2006
  3. Chris K.
    Replies:
    3
    Views:
    724
    Chris K.
    Jun 8, 2008
  4. Abby Lee
    Replies:
    5
    Views:
    376
    Abby Lee
    Aug 2, 2004
  5. Sam Roberts
    Replies:
    15
    Views:
    277
    Sam Roberts
    Feb 7, 2005
Loading...

Share This Page