wrote:
> 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