1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
NISA [10]
3 years ago
9

Implement the above in c++, you will write a test program named create_and_test_hash.cc . Your programs should run from the term

inal like so:
./create_and_test_hash should be "quadratic" for quadratic probing, "linear" for linear probing, and "double" for double hashing. For example, you can write on the terminal:
./create_and_test_hash words.txt query_words.txt quadratic You can use the provided makefile in order to compile and test your code. Resources have been posted on how to use makefiles. For double hashing, the format will be slightly different, namely as follows:
./create_and_test_hash words.txt query_words.txt double The R value should be used in your implementation of the double hashing technique discussed in class and described in the textbook: hash2 (x) = R – (x mod R). Q1. Part 1 (15 points) Modify the code provided, for quadratic and linear probing and test create_and_test_hash. Do NOT write any functionality inside the main() function within create_and_test_hash.cc. Write all functionality inside the testWrapperFunction() within that file. We will be using our own main, directly calling testWrapperFunction().This wrapper function is passed all the command line arguments as you would normally have in a main. You will print the values mentioned in part A above, followed by queried words, whether they are found, and how many probes it took to determine so. Exact deliverables and output format are described at the end of the file. Q1. Part 2 (20 points) Write code to implement double_hashing.h, and test using create_and_test_hash. This will be a variation on quadratic probing. The difference will lie in the function FindPos(), that has to now provide probes using a different strategy. As the second hash function, use the one discussed in class and found in the textbook hash2 (x) = R – (x mod R). We will test your code with our own R values. Further, please specify which R values you used for testing your program inside your README. Remember to NOT have any functionality inside the main() of create_and_test_hash.cc
You will print the current R value, the values mentioned in part A above, followed by queried words, whether they are found, and how many probes it took to determine so. Exact deliverables and output format are described at the end of the file. Q1. Part 3 (35 points) Now you are ready to implement a spell checker by using a linear or quadratic or double hashing algorithm. Given a document, your program should output all of the correctly spelled words, labeled as such, and all of the misspelled words. For each misspelled word you should provide a list of candidate corrections from the dictionary, that can be formed by applying one of the following rules to the misspelled word: a) Adding one character in any possible position b) Removing one character from the word c) Swapping adjacent characters in the word Your program should run as follows: ./spell_check
You will be provided with a small document named document1_short.txt, document_1.txt, and a dictionary file with approximately 100k words named wordsEN.txt. As an example, your spell checker should correct the following mistakes. comlete -> complete (case a) deciasion -> decision (case b) lwa -> law (case c)
Correct any word that does not exist in the dictionary file provided, (even if it is correct in the English language). Some hints: 1. Note that the dictionary we provide is a subset of the actual English dictionary, as long as your spell check is logical you will get the grade. For instance, the letter "i" is not in the dictionary and the correction could be "in", "if" or even "hi". This is an acceptable output. 2. Also, if "Editor’s" is corrected to "editors" that is ok. (case B, remove character) 3. We suggest all punctuation at the beginning and end be removed and for all words convert the letters to lower case (for e.g. Hello! is replaced with hello, before the spell checking itself).
Do NOT write any functionality inside the main() function within spell_check.cc. Write all functionality inside the testSpellingWrapper() within that file. We will be using our own main, directly calling testSpellingWrapper(). This wrapper function is passed all the command line arguments as you would normally have in a main
Computers and Technology
1 answer:
likoan [24]3 years ago
4 0
This question is way to long I don’t even understand what your asking
You might be interested in
WILL GIVE BRAINLIEST!!! PLEASE HELP!!!
padilas [110]

Answer:

BOI I got ricked rolled!

Explanation:

He done it!

5 0
3 years ago
Boolean logic deals with statements having one of _____ values.
Alexxandr [17]

Answer:

2 values

Explanation:

boolean statements can only be True or False

6 0
3 years ago
1. How can you help prevent being a target of cyberbullying?
zheka24 [161]
1. stand up for yourself, keep your socials on private and only accept for your close friends and relatives.

2. screenshot and print out evidence, show to a trusted adult and even you can take legal action.
5 0
3 years ago
Read 2 more answers
After execution of the code fragment
lesya692 [45]
Yes the output is 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  





8 0
4 years ago
# 1) Complete the function to return the result of the conversion
seraphim [82]

Answer:

See explanation

Explanation:

Replace the ____ with the expressions in bold and italics

1)  <em>        return km</em>

 

return km returns the result of the computation

2)  = <em>convert_distance(my_trip_miles)</em>

convert_distance(my_trip_miles) calls the function and passes my_trip_miles to the function

3)  + <em>str(my_trip_km)</em>

The above statement prints the returned value

4)  +str(my_trip_km * 2)

The above statement prints the returned value multiplied by 2

3 0
3 years ago
Other questions:
  • How many inputs are included in the following requirement? REQUIREMENT: Write a program that asks the employee for their age. Th
    6·1 answer
  • How can styles be used in Word? Check all that apply. to standardize the font size of a title in a Word document to standardize
    9·2 answers
  • Which of the following is an advantage to using plain text format? Check all of the boxes that apply.
    15·2 answers
  • In the dewey decimal sysytem, the call number 800 notes which section
    10·1 answer
  • Cookies Are Us runs a series of 100 cookie stores across the Midwestern United States and central Canada. At the end of each day
    13·1 answer
  • Energy is required in order to produce any sound.<br> true<br> false
    15·2 answers
  • Check ALL of the correct answers.
    13·1 answer
  • Decision support systems (or DSSs) model information using OLAP, which provides assistance in evaluating and choosing among diff
    7·1 answer
  • Mention three types of pipeline hazards​
    6·2 answers
  • List at least three kinds of harm a company could experience from electronic espionage or unauthorized viewing of confidential c
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!