Binary search tree and Dictionary

B

bear220720

I have a big problem about how to make this C++ program.
I was asked to use binary search tree to built a dictionary.
This program must have some function,
1. Read a article file and include every word of it into the
dictionary.
2. When enter a word, it can make a search and report the word where
the search eventually stops.
If anyone has this kind of program, please send to me.
Thank you!
 
K

Karl Heinz Buchegger

I have a big problem about how to make this C++ program.
I was asked to use binary search tree to built a dictionary.
This program must have some function,
1. Read a article file and include every word of it into the
dictionary.
2. When enter a word, it can make a search and report the word where
the search eventually stops.
If anyone has this kind of program, please send to me.
Thank you!

Show your attempt for this homework question and tell us what your
specific problem is. Then somebody will try to help you with
that specific problem.
But nobody is going to write this program for you from scratch.
 
R

Rolf Magnus

Karl said:
Show your attempt for this homework question and tell us what your
specific problem is. Then somebody will try to help you with
that specific problem.
But nobody is going to write this program for you from scratch.

I will - for 250 Euros.
 
T

Thomas Matthews

I have a big problem about how to make this C++ program.
I was asked to use binary search tree to built a dictionary.
This program must have some function,
1. Read a article file and include every word of it into the
dictionary.
2. When enter a word, it can make a search and report the word where
the search eventually stops.
If anyone has this kind of program, please send to me.
Thank you!
1. Read a line from the file.
2. Extact a word from that line.
3. Add word to the container (list, vector, map, etc.)
4. Repeat at step 2.
5. Display contents of container.
6. After the above works, expand program to read until
the end of the file is reached.

I would use the std::set container.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 
R

red floyd

Thomas said:
1. Read a line from the file.
2. Extact a word from that line.
3. Add word to the container (list, vector, map, etc.)
4. Repeat at step 2.
5. Display contents of container.
6. After the above works, expand program to read until
the end of the file is reached.

I would use the std::set container.

Of course, that will get him an F on his homework assignment, since he's
probably supposed to roll his own BST. :)
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top