In search of a good example.

C

codefixer

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
 
T

Thomas Matthews

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?
 
A

Andrew Koenig

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.
 
M

Marcin Kalicinski

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
 
D

DHOLLINGSWORTH2

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
 
A

Alan Brown

(e-mail address removed) wrote in
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top