Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,386 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,196 people online right now. Registration is fast and FREE... Join Now!




how help me?

 
Reply to this topicStart new topic

how help me?, c++ program

simo
post 22 Aug, 2008 - 02:14 PM
Post #1


New D.I.C Head

*
Joined: 22 Aug, 2008
Posts: 1

This assignment is intended to provide you a good understanding of how to use Hash Tables.
One natural use of a set is to hold the words in a spelling dictionary. This makes looking up the words very efficient. In this assignment, you are asked to implement and use such a dictionary. You are responsible for following the rules of good programming style.
The first part of the assignment consists in writing a class that implements an Open Hash Table of strings. That is, the table is stored as an array of simple linked lists of strings (or, more precisely, an array of pointers to such lists). You might need to look up the implementation of simple linked list operations in your slides. Your class should be an implementation of the ADT Set of Strings. The class must include:
• A function add(s) that adds the string s to the table, if it is not already there.
• A function remove(s) that removes the string s from the table, if it's there.
• A function contains(s) that returns a Boolean value that checks whether the string s is in the table.
• A function size() that returns the number of strings in the table.
• A hash function to compute the hash code of a string. This function can be private.
• A constructor that accepts the size of the table as a parameter.
The second part of the assignment consists of the following:
1. Write a function that takes an input text and broken it up in a list of words, each one per a line. The input must be a text file, and the output is directed to a text file.
2. Write a function that takes an input text (with each word per a line) and create a hash table of an appropriate size for the number of words in the input. It should read the words from the input (text file) and add them to the hash table. You might need to verify, if a word is already exit in the dictionary.
3. Write a function that takes an input text (with each word per a line) and output a list of "near misses". For the search of "near misses",
• Construct every string that can be made by deleting one letter from the word. (n possibilities, where n is the length of the word)
• Construct every string that can be made by swapping two neighboring characters in the string. (n-1 possibilities).
• Construct every string that can be made by inserting any letter of the alphabet at any position in the string. (26*(n+1) possibilities). you should list the near misses in alphabetical order.
• Construct every string that can be made by replacing each letter in the word with some letter of the alphabet. (26*n possibilities (including the original word n times, which is probably easier than avoiding it))
The third part of the assignment consists of writing a program with a simple graphical interface that allows the user the following:
1. Browsing for selecting the input file that will be considered as a dictionary,
2. An input area that can be used to enter a text
3. A button "treat" that when pressed, the program outputs the "near misses" of each word given by one of the previous methods


[size=2][size=4]
User is offlineProfile CardPM

Go to the top of the page

KYA
post 22 Aug, 2008 - 02:43 PM
Post #2


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 4,205



Thanked 50 times

Dream Kudos: 1150
My Contributions


Welcome to DIC, but as I'm sure many community members will inform you, we don't just sit around all day hoping someone will come and dump a problem in our proverbial laps. We wouldn't mind helping, but one must show some effort. Have you planned out your program and algorithms? How are you going to go about input, calculation, etc...?

The point of taking classes (since this looks like a HW assignment) is that you become a better programmer. If you can't do this, how are you planning on making a living out of coding?
User is online!Profile CardPM

Go to the top of the page

gabehabe
post 22 Aug, 2008 - 02:53 PM
Post #3


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


It's a pretty simple assignment. If you sit down, and read it carefully, then the answers should pop out at you. Just jot down some notes, and consider how the program should look. Variables/functions are already planned, thanks to the assignment. All you need to do is give them meaning.

QUOTE
[size=2][size=4]
I totally agree.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/22/08 06:45AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month