Question: PLEASE PLEASE PLEASE HELP WITH THIS ASSIGNMENT, IF YOU DO I'LL GIVE INSTANT THUMBS UP AND SEND $10 THROUGH CHEGG IF THATS SOMEHOW POSSIBLE, PLEASE
PLEASE PLEASE PLEASE HELP WITH THIS ASSIGNMENT, IF YOU DO I'LL GIVE INSTANT THUMBS UP AND SEND $10 THROUGH CHEGG IF THATS SOMEHOW POSSIBLE,
PLEASE READ THIS CAREFULLY BECAUSE IT'LL HELP YOU UNDERSTAND THE ASSIGNMENT BETTER AND MAYBE HELP YOU COMPLETE IT FASTER..
IVE INCLUDED TESTFILES INPUT "T1" AND TESTFILE OUTPUT "O1" AS WELL AS THE "GRADER.SH" FOR YOU TO RUN IN YOUR TERMINAL TO SEE IF THE CODE YOU'VE WRITTEN IS CORRECT. IVE ALSO INCLUDED INSTRUCTUONS WITHIN THE GRADER FILE TO MAKE IT EVEN EASIER ON YOURSELF! :).. THE INPUT SHOULD BE EXACTLY THE SAME AS THAT AS INPUT FILE "T1" AND THE OUTPUT SHOULD BE THE EXACT STRUCTURE OF OUTPUT FILE "O1" IF THESE BOTH ARE THE SAME THEN THE "GRADER.SH" WILL SHOW THE CODE IS CORRECT WHEN YOU RUN IT :)

___________________________GRADER.SH_____________________________________
# This "Grader.sh" script is for testing the correctness of your code with a
# collection of test files.
#
#
# 1. Create a working directory and put in it this script (Grader.sh), your
# code in a single file jsmith5.cpp(EXAMPLE NAME), and all the test files (inputs and
# outputs) inside a subdirectory called testfiles/. Ensure Grader.sh has
# execute permissions:
# $ chmod +x ./Grader.sh
# 2. Compile your code with the GNU C++ compiler using the 2011 C++ standard
# and put the resulting executable in a file a.exe:
# $ g++ -std=c++11 -o a.exe jsmith5.cpp
# 3. Run the Grader.sh script:
# $ ./Grader.sh
# This will test all examples and print whether they work or not, like this:
# Test 1: correct.
# Test 2: correct.
# Test 3: INCORRECT.
# Test 4: correct.
# Test 5: correct.
# Total correct: 4/5
# 4. To see the output of your code with a given test file:
# $ ./a.exe
# This should be identical to testfiles/o3 for the code to pass that test.
# Find test files that exist in testfiles/ and put their numbers in an array.
# Ex: o1 o10 o3 -> tests=(1 10 3)
tests=(); for v in `find testfiles/o*`; do tests+=(${v:11}); done
# Sort them. Ex: tests=(1 3 10)
tests=($(printf '%d ' ${tests[@]} | sort -n))
# Apply a.exe to each test file and count how many are correct.
correct=0;
for i in ${tests[@]}; do
./a.exe /devull
if [ "$?" -eq 0 ] ; then # if exit code is 0 then correct
echo "Test $i: correct."
((correct=correct+1))
else
echo "Test $i: INCORRECT."
fi
done
echo "Total correct: "$correct"/"${#tests[@]};
______________INPUT FILE "T1"____________________
0 13 26 39 52 65 78 91 104 117 130 143 156 -1 13 45 26 1 2 3 22 39 0 45 46 47 52 65 78 91 104 117 130 1256 478 143 678 987 145 178 963 2499 32195 156 7 -2 45 26 1 2 3 22 39 0 45 47 65 78 91 117 1256 478 143 678 987 145 178 963 2499 32195 156 7 -3
____________OUTPUT FILE "O1"_______________
0 143 78 13 91 26 104 39 117 52 130 65 156 3 NOT_FOUND 5 NOT_FOUND NOT_FOUND NOT_FOUND NOT_FOUND 7 0 NOT_FOUND NOT_FOUND NOT_FOUND 9 11 2 4 6 8 10 NOT_FOUND NOT_FOUND 1 NOT_FOUND NOT_FOUND NOT_FOUND NOT_FOUND NOT_FOUND NOT_FOUND NOT_FOUND 12 NOT_FOUND
13
104
52 130
Hash table with open addressing In this assignment you are requested to implement insert, search, and delete operations for an open-addressing hash table with double hashing. Create an empty hash table of size m- 13. Each integer of the input will be a key that you should insert into the hash table. Use the double hashing function h(k, i) - (hi(k) + ih2(k)) mod 13 where hi(k) -k mod 13 and h2(k)- 1+ (k mod 11). The input terminates when the key -1 is read (such a key must not be inserted in the hash table). At that point, print the content of the hash table to the screen (see sample input/output below for the printing format). Then, read integers from the input until the number -2 is found (do not process that number). For each number inputted, print the index of the element in the hash table. If the number is not inside the hash table, print NOT FOUND. Finally, read integers from the input until the number -3 is found (do not process that number). For each number inputted, delete it from the hash table (note that the integer might not be in the table). Once the integer -3 is found, print the hash table Hash table with open addressing In this assignment you are requested to implement insert, search, and delete operations for an open-addressing hash table with double hashing. Create an empty hash table of size m- 13. Each integer of the input will be a key that you should insert into the hash table. Use the double hashing function h(k, i) - (hi(k) + ih2(k)) mod 13 where hi(k) -k mod 13 and h2(k)- 1+ (k mod 11). The input terminates when the key -1 is read (such a key must not be inserted in the hash table). At that point, print the content of the hash table to the screen (see sample input/output below for the printing format). Then, read integers from the input until the number -2 is found (do not process that number). For each number inputted, print the index of the element in the hash table. If the number is not inside the hash table, print NOT FOUND. Finally, read integers from the input until the number -3 is found (do not process that number). For each number inputted, delete it from the hash table (note that the integer might not be in the table). Once the integer -3 is found, print the hash table
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
