473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Binary search tree and Dictionary

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!

Jul 23 '05 #1
6 7746
be********@gmail.com 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!


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.

--
Karl Heinz Buchegger
kb******@gascad.at
Jul 23 '05 #2
Karl Heinz Buchegger wrote:
be********@gmail.com 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!


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.

Jul 23 '05 #3

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:d6*************@news.t-online.com...
Karl Heinz Buchegger wrote:
be********@gmail.com 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!


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.


Oh damn, if I had known that a long time ago ;-)

Chris
Jul 23 '05 #4
be********@gmail.com 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
Jul 23 '05 #5
Thomas Matthews wrote:
be********@gmail.com 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.


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

You can check out www.eassignment.net for help with your assignments.
They are really helpful.

Simon Tanner

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: jova | last post by:
Is there a difference between a Binary Tree and a Binary Search Tree? If so can someone please explain. Thank You.
0
by: j | last post by:
Hi, Anyone out there with binary search tree experience. Working on a project due tomorrow and really stuck. We need a function that splits a binary tree into a bigger one and smaller one(for a...
3
by: tsunami | last post by:
hi all; I have an array and want to insert all the elements from this array to a binary search tree.That array is an object of the class of a stringtype which includes overloaded "< > = =="...
4
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working,...
4
by: sun6 | last post by:
this is a program counting words from "text_in.txt" file and writing them in "text_out.txt". it uses binary tree search, but there is an error when i use insert () thanks for any help ...
15
by: Foodbank | last post by:
Hi all, I'm trying to do a binary search and collect some stats from a text file in order to compare the processing times of this program (binary searching) versus an old program using linked...
1
by: hn.ft.pris | last post by:
I have the following code: Tree.h defines a simple binary search tree node structure ########## FILE Tree.h ################ #ifndef TREE_H #define TREE_H //using namespace std; template...
11
by: Defected | last post by:
Hi, How i can create a Binary Search Tree with a class ? thanks
7
by: Vinodh | last post by:
Started reading about Binary Trees and got the following questions in mind. Please help. Definition of a Binary Tree from "Data Structures using C and C++ by Tanenbaum" goes like this, "A...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.