473,785 Members | 2,506 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7775
be********@gmai l.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********@gmai l.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********@gmai l.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********@gmai l.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.l earn.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********@gmai l.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
2533
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
4255
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 random binary search tree. We've tried everything but are in the land of pointer hell. If someone could help it would be a huge help. our code follows. We've tried 2 diff methods the split() and splitter() functions #include <iostream> #include...
3
2853
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 "< > = ==" functions and every other thing it needs. void InsertElementFromArray(StringType Array,int first element,int last element);
4
9020
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, even the removal, I just don't know how to keep track of the parent, so that I can set its child to the child of the node to be removed. IE - if I had C / \ B D
4
4074
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 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h>
15
5100
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 lists. I'm totally new to binary searches by the way. Can anyone help me with the commented sections below? Much of the code such as functions and printfs has already been completed. Any help is greatly appreciated. Thanks,
1
2952
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 <typename Tclass Tree{ private: Tree<T*left;
11
1191
by: Defected | last post by:
Hi, How i can create a Binary Search Tree with a class ? thanks
7
3871
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 binary tree is a finite set of elements that is either empty or is partitioned into three disjoint subsets. The first subset contains a single element called the 'Root' of the tree. The other two subsets are themselves binary trees, called the 'Left'...
0
9485
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.