SlideShare a Scribd company logo
CSCE 3110 Data Structures & Algorithms Summer 2019
1 of 12
Project 3 – Hopscotch Hash Table
Due: 11:59 PM on Friday, June 21, 2019
PROGRAM DESCRIPTION
In this C++ program, you will implement an efficient hopscotch
hash table that improves
on the classic linear probing algorithm. Specifically, you will
use a TABLE_SIZE = 17
and use the single hash function ℎ(�) = � mod
�����_����. You shall resolve
collisions using linear probing where the maximal length of the
probe sequence (i.e.,
distance away from the original hash location) is bound by the
hopscotch hash
algorithm where MAX_DIST = 4.
You shall support the following five operations that are menu
driven:
1. Insert Value
2. Delete Value
3. Search Value
4. Output Table
5. Exit Program
All data shall be entered through the console and consist of
integers. You may assume
valid data, though data may be out of range (i.e., zero, negative
integers or possibly out
of range of menu options). Your algorithm to find the next
available slot is bound by the
end of the table so that the linear probe sequence need not be
circular. In other words,
you do not need to wrap around beyond the last element of the
array to the first for
either the linear probe or the bound for the hopscotch algorithm.
For example, if the
user attempts to insert 33 which hashes to index position 16
(i.e., 33 %TABLE_SIZE) in
the array, but an element already exists at that location, the
insert will fail as there are
no more array locations beyond this to attempt to insert the
element.
You must keep an item array containing the elements as well as
an associated hop
array that indicates positions in the item array that are occupied
with items that hash to
the same value. You should also provide specific feedback to
the user on successful
operations or when an operation failed. The search should
utilize the hash value and
then perhaps a linear probe of MAX_DIST – 1 index locations,
but you should not
simply search the entire array to accomplish this operation. Be
sure to handle the case
that requires multiple hops (i.e., using recursion) to get the
value within the correct
range.
REQUIREMENTS
• Your code should be well documented in terms of comments.
For example, good
comments in general consist of a header (with your name,
course section, date,
and brief description), comments for each variable, and
commented blocks of
code.
• Your program will be graded based largely on whether it
works correctly on the
CSE machines (e.g., cse01, cse02, …, cse06), so you should
make sure that
your program compiles and runs on a CSE machine.
aemalki
aemalki
aemalki
aemalki
aemalki
aemalki
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
2 of 12
• You should contact your instructor if there is any question
about what is being
asked for.
• This is an individual programming assignment that must be the
sole work of the
individual student. Any instance of academic dishonesty will
result in a grade of
“F” for the course, along with a report filed into the Academic
Integrity Database.
SAMPLE OUTPUT (input in bold):
$ ./a.out
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 5
5 inserted at position 5.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 7
ERROR: Please select operation between 1 and 5, inclusively.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 6
6 inserted at position 6.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 22
22 inserted at position 7.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 23
23 inserted at position 8.
HOPSCOTCH HASH MENU:
1 - Insert Value
aemalki
aemalki
aemalki
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
3 of 12
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | | 0000 |
| 1 | | 0000 |
| 2 | | 0000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | 5 | 1010 |
| 6 | 6 | 1010 |
| 7 | 22 | 0000 |
| 8 | 23 | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | | 0000 |
| 16 | | 0000 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 39
39 inserted at position 6.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | | 0000 |
| 1 | | 0000 |
| 2 | | 0000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | 5 | 1110 |
| 6 | 39 | 0011 |
| 7 | 22 | 0000 |
| 8 | 23 | 0000 |
| 9 | 6 | 0000 |
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
4 of 12
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | | 0000 |
| 16 | | 0000 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 56
ERROR: Unable to insert 56 into Hash Table: Hopscotch Hash
Failed
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 3
Enter positive integer value to search for in Hopscotch Hash
Table: 39
39 found at position 6.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 2
Enter positive integer value to delete from Hopscotch Hash
Table: 6
6 deleted from position 9.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | | 0000 |
| 1 | | 0000 |
| 2 | | 0000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | 5 | 1110 |
| 6 | 39 | 0010 |
| 7 | 22 | 0000 |
| 8 | 23 | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
aemalki
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
5 of 12
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | | 0000 |
| 16 | | 0000 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 19
19 inserted at position 2.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 50
50 inserted at position 16.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 56
56 inserted at position 8.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | | 0000 |
| 1 | | 0000 |
| 2 | 19 | 1000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | 5 | 1111 |
| 6 | 39 | 0001 |
| 7 | 22 | 0000 |
| 8 | 56 | 0000 |
| 9 | 23 | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
aemalki
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
6 of 12
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | | 0000 |
| 16 | 50 | 1000 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: -5
Enter positive integer value to insert into Hopscotch Hash
Table: 16
ERROR: Unable to insert 16 into Hash Table: Linear Probe
Failed
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 5
Program terminated by user...
BONUS OPPORTUNITY:
• For those students who have completed all the requirements,
you may attempt to
add circular functionality to the linear probe (i.e., not just to the
end of the table)
for up to 15 bonus points.
• SAMPLE OUTPUT for BONUS showing circular table rolling
over (input in bold):
$ ./a.out
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 16
16 inserted at position 16.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 15
15 inserted at position 15.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
aemalki
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
7 of 12
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 33
33 inserted at position 0.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0000 |
| 1 | | 0000 |
| 2 | | 0000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | 15 | 1000 |
| 16 | 16 | 1100 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 50
50 inserted at position 1.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0000 |
| 1 | 50 | 0000 |
| 2 | | 0000 |
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
8 of 12
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | 15 | 1000 |
| 16 | 16 | 1110 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 32
32 inserted at position 16.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0000 |
| 1 | 50 | 0000 |
| 2 | 16 | 0000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | 15 | 1100 |
| 16 | 32 | 0111 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
aemalki
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
9 of 12
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 67
ERROR: Unable to insert 67 into Hash Table: Hopscotch Hash
Failed
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0000 |
| 1 | 50 | 0000 |
| 2 | 16 | 0000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | | 0000 |
| 15 | 15 | 1100 |
| 16 | 32 | 0111 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 14
14 inserted at position 14.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0000 |
| 1 | 50 | 0000 |
| 2 | 16 | 0000 |
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
10 of 12
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | 14 | 1000 |
| 15 | 15 | 1100 |
| 16 | 32 | 0111 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 31
ERROR: Unable to insert 31 into Hash Table: Hopscotch Hash
Failed
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0000 |
| 1 | 50 | 0000 |
| 2 | 16 | 0000 |
| 3 | | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | 14 | 1000 |
| 15 | 15 | 1100 |
| 16 | 32 | 0111 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
aemalki
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
11 of 12
4 - Output Table
5 - Exit Program
Enter operation to perform: 1
Enter positive integer value to insert into Hopscotch Hash
Table: 17
17 inserted at position 3.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0001 |
| 1 | 50 | 0000 |
| 2 | 16 | 0000 |
| 3 | 17 | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | 14 | 1000 |
| 15 | 15 | 1100 |
| 16 | 32 | 0111 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 2
Enter positive integer value to delete from Hopscotch Hash
Table: 32
32 deleted from position 16.
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 4
HOPSCOTCH HASH TABLE:
+------------------+
| # | item | hop |
+------------------+
| 0 | 33 | 0001 |
| 1 | 50 | 0000 |
| 2 | 16 | 0000 |
aemalki
aemalki
CSCE 3110 Data Structures & Algorithms Summer 2019
12 of 12
| 3 | 17 | 0000 |
| 4 | | 0000 |
| 5 | | 0000 |
| 6 | | 0000 |
| 7 | | 0000 |
| 8 | | 0000 |
| 9 | | 0000 |
| 10 | | 0000 |
| 11 | | 0000 |
| 12 | | 0000 |
| 13 | | 0000 |
| 14 | 14 | 1000 |
| 15 | 15 | 1000 |
| 16 | | 0111 |
+------------------+
HOPSCOTCH HASH MENU:
1 - Insert Value
2 - Delete Value
3 - Search Value
4 - Output Table
5 - Exit Program
Enter operation to perform: 5
Program terminated by user...
SUBMISSION:
• You will electronically submit your source code file(s) and a
README file where
you explain all of the information for the grader to properly
grade your program
(e.g., how to compile it, how to run it, etc.) to the Project 3
dropbox in Canvas by
the due date. Also submit a screen-shot (or use the “script”
command) of your
program running. Be sure to include your name in each program
file and in the
README file.
• Note that this program should be done individually. The
program will be checked
using a code plagiarism tool against other solutions, so please
be sure that all
work submitted is your own.
aemalki
aemalki
aemalki
aemalki
aemalki
ASS 6
In this Assignment, you will build on the knowledge you gained
while completing the Discussion Board requirement. At this
time, you will perform a textual analysis of protest songs. To
complete this Assignment, you must choose one protest song
from the 1960s and one protest song from within the last 5
years. For each song, locate at least three themes and then
compare/contrast these themes. The Assignment must be four
pages long, including the title page, content pages, and works
cited page.
1. Choose one protest song from the 1960s and one protest song
from today. Locate the lyrics for each song and provide the
complete lyrics in an appendix to your Assignment or in a
separate file. Cite the songs and lyrics using APA style.
2. Locate at least three themes in each song. Compare and
contrast these themes using quotes from the lyrics to illustrate
each theme.
3. Summarize your findings in a concluding paragraph.
Rubric: 6
Grade:
Grading Criteria
A: 81-90 points
· Essay identifies at least three themes in each chosen protest
song.
· Essay provides thoughtful commentary to illustrate each
theme.
· Identified themes are clearly compared and contrasted between
the
two time periods.
· Essay is clearly written and meets the posted length
requirements.
• Complete song lyrics are included and cited using APA style.
B: 72-80 points
· Essay identifies at least three themes in each chosen protest
song.
· Essay provides thoughtful commentary to illustrate each
theme.
· Essay provides a weak comparison of the themes across the
two
time periods.
· One of the three required parts is missing from the essay.
· Essay meets the posted length requirements.
· Complete song lyrics are included and cited using APA style.
C: 63-71 points
· Essay identifies less than three themes in each chosen protest
song.
· Essay provides little commentary to illustrate each theme.
· One or more of the three required parts is missing from the
essay.
· Essay does not meet posted length requirements.
· Essay uses no supporting sources.
· Essay does not include complete song lyrics.
D: 54-62 points
· Essay is only partially on topic, lacks originality, and vaguely.
mentions the assignment topic.
· Essay does not meet posted length requirements.
F: 0-53 points
· Essay is off topic and lacks originality.
· Essay makes little or no references to assignment questions.
· Essay does not meet posted length requirements.
· Essay contains extensive plagiarized text= graded as zero.
5% or up to 8 points are deducted from your assignment for
grammatical, incorrect or missing APA formatting and citations,
typographic or word usage problems.
CSCE 3110 Data Structures & Algorithms Summer 2019   1 of .docx

More Related Content

PDF
Data structures
PDF
12111 data structure
PPTX
BCS304 Module 5 slides DSA notes 3rd sem
PPTX
Google Farewell Competition.pptx
PDF
Coding interview preparation
PDF
Data struture and aligorism
PDF
Data structures
12111 data structure
BCS304 Module 5 slides DSA notes 3rd sem
Google Farewell Competition.pptx
Coding interview preparation
Data struture and aligorism

Similar to CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx (20)

PPTX
Hashing algorithms and its uses
DOC
Course module of DS
PDF
DSA Report.pdf
PPTX
closed hashing.pptx
PPTX
closed hashing.pptx
PDF
PPT
4.4 hashing02
PPTX
Array Data StructureData StructureData Structure.pptx
PDF
Elementary algorithms
PDF
Data Structure in Hindi.pdf
PDF
data structures
PDF
Zoho Interview Questions By Scholarhat.pdf
PPTX
stack & queues .pptx
PDF
Esoteric Data structures
PPTX
Unit 8 searching and hashing
PDF
Chapter 1
PPTX
session 15 hashing.pptx
PPTX
Chapter 4.pptx
PPTX
Lec12-Hash-Tables-27122022-125641pm.pptx
PPTX
RAJAT PROJECT.pptx
Hashing algorithms and its uses
Course module of DS
DSA Report.pdf
closed hashing.pptx
closed hashing.pptx
4.4 hashing02
Array Data StructureData StructureData Structure.pptx
Elementary algorithms
Data Structure in Hindi.pdf
data structures
Zoho Interview Questions By Scholarhat.pdf
stack & queues .pptx
Esoteric Data structures
Unit 8 searching and hashing
Chapter 1
session 15 hashing.pptx
Chapter 4.pptx
Lec12-Hash-Tables-27122022-125641pm.pptx
RAJAT PROJECT.pptx
Ad

More from mydrynan (20)

DOCX
CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
DOCX
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
DOCX
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
DOCX
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
DOCX
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
DOCX
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
DOCX
CSCI  132  Practical  Unix  and  Programming   .docx
DOCX
CSCI 714 Software Project Planning and EstimationLec.docx
DOCX
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
DOCX
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
DOCX
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
DOCX
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
DOCX
CSCE 1040 Homework 2 For this assignment we are going to .docx
DOCX
CSCE509–Spring2019Assignment3updated01May19DU.docx
DOCX
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
DOCX
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
DOCX
CSC-321 Final Writing Assignment In this assignment, you .docx
DOCX
Cryptography is the application of algorithms to ensure the confiden.docx
DOCX
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
DOCX
Cryptography KeysCryptography provides confidentiality, inte.docx
CSIA 413 Cybersecurity Policy, Plans, and Programs.docx
CSIS 100CSIS 100 - Discussion Board Topic #1One of the object.docx
CSI Paper Grading Rubric- (worth a possible 100 points) .docx
CSIA 413 Cybersecurity Policy, Plans, and ProgramsProject #4 IT .docx
CSI 170 Week 3 AssingmentAssignment 1 Cyber Computer CrimeAss.docx
CSE422 Section 002 – Computer Networking Fall 2018 Ho.docx
CSCI  132  Practical  Unix  and  Programming   .docx
CSCI 714 Software Project Planning and EstimationLec.docx
CSCI 561Research Paper Topic Proposal and Outline Instructions.docx
CSCI 561 DB Standardized Rubric50 PointsCriteriaLevels of .docx
CryptographyLesson 10© Copyright 2012-2013 (ISC)², Inc. Al.docx
CSCI 352 - Digital Forensics Assignment #1 Spring 2020 .docx
CSCE 1040 Homework 2 For this assignment we are going to .docx
CSCE509–Spring2019Assignment3updated01May19DU.docx
CSCI 2033 Elementary Computational Linear Algebra(Spring 20.docx
CSCI 340 Final Group ProjectNatalie Warden, Arturo Gonzalez, R.docx
CSC-321 Final Writing Assignment In this assignment, you .docx
Cryptography is the application of algorithms to ensure the confiden.docx
CSc3320 Assignment 6 Due on 24th April, 2013 Socket programming .docx
Cryptography KeysCryptography provides confidentiality, inte.docx
Ad

Recently uploaded (20)

PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Institutional Correction lecture only . . .
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Pharma ospi slides which help in ospi learning
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
master seminar digital applications in india
PPTX
Cell Types and Its function , kingdom of life
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Pre independence Education in Inndia.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
human mycosis Human fungal infections are called human mycosis..pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
01-Introduction-to-Information-Management.pdf
Basic Mud Logging Guide for educational purpose
Institutional Correction lecture only . . .
Anesthesia in Laparoscopic Surgery in India
Sports Quiz easy sports quiz sports quiz
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Pharma ospi slides which help in ospi learning
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPH.pptx obstetrics and gynecology in nursing
master seminar digital applications in india
Cell Types and Its function , kingdom of life
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Final Presentation General Medicine 03-08-2024.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
Pre independence Education in Inndia.pdf
Supply Chain Operations Speaking Notes -ICLT Program

CSCE 3110 Data Structures & Algorithms Summer 2019 1 of .docx

  • 1. CSCE 3110 Data Structures & Algorithms Summer 2019 1 of 12 Project 3 – Hopscotch Hash Table Due: 11:59 PM on Friday, June 21, 2019 PROGRAM DESCRIPTION In this C++ program, you will implement an efficient hopscotch hash table that improves on the classic linear probing algorithm. Specifically, you will use a TABLE_SIZE = 17 and use the single hash function ℎ(�) = � mod �����_����. You shall resolve collisions using linear probing where the maximal length of the probe sequence (i.e., distance away from the original hash location) is bound by the hopscotch hash algorithm where MAX_DIST = 4. You shall support the following five operations that are menu driven: 1. Insert Value 2. Delete Value 3. Search Value 4. Output Table 5. Exit Program All data shall be entered through the console and consist of integers. You may assume valid data, though data may be out of range (i.e., zero, negative
  • 2. integers or possibly out of range of menu options). Your algorithm to find the next available slot is bound by the end of the table so that the linear probe sequence need not be circular. In other words, you do not need to wrap around beyond the last element of the array to the first for either the linear probe or the bound for the hopscotch algorithm. For example, if the user attempts to insert 33 which hashes to index position 16 (i.e., 33 %TABLE_SIZE) in the array, but an element already exists at that location, the insert will fail as there are no more array locations beyond this to attempt to insert the element. You must keep an item array containing the elements as well as an associated hop array that indicates positions in the item array that are occupied with items that hash to the same value. You should also provide specific feedback to the user on successful operations or when an operation failed. The search should utilize the hash value and then perhaps a linear probe of MAX_DIST – 1 index locations, but you should not simply search the entire array to accomplish this operation. Be sure to handle the case that requires multiple hops (i.e., using recursion) to get the value within the correct range. REQUIREMENTS • Your code should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date,
  • 3. and brief description), comments for each variable, and commented blocks of code. • Your program will be graded based largely on whether it works correctly on the CSE machines (e.g., cse01, cse02, …, cse06), so you should make sure that your program compiles and runs on a CSE machine. aemalki aemalki aemalki aemalki aemalki aemalki aemalki aemalki
  • 4. CSCE 3110 Data Structures & Algorithms Summer 2019 2 of 12 • You should contact your instructor if there is any question about what is being asked for. • This is an individual programming assignment that must be the sole work of the individual student. Any instance of academic dishonesty will result in a grade of “F” for the course, along with a report filed into the Academic Integrity Database. SAMPLE OUTPUT (input in bold): $ ./a.out HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 5 5 inserted at position 5. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 7 ERROR: Please select operation between 1 and 5, inclusively. HOPSCOTCH HASH MENU:
  • 5. 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 6 6 inserted at position 6. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 22 22 inserted at position 7. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 23 23 inserted at position 8. HOPSCOTCH HASH MENU: 1 - Insert Value aemalki
  • 6. aemalki aemalki aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 3 of 12 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | | 0000 | | 1 | | 0000 | | 2 | | 0000 | | 3 | | 0000 | | 4 | | 0000 | | 5 | 5 | 1010 | | 6 | 6 | 1010 | | 7 | 22 | 0000 | | 8 | 23 | 0000 | | 9 | | 0000 |
  • 7. | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | | 0000 | | 16 | | 0000 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 39 39 inserted at position 6. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | | 0000 | | 1 | | 0000 | | 2 | | 0000 | | 3 | | 0000 | | 4 | | 0000 | | 5 | 5 | 1110 | | 6 | 39 | 0011 |
  • 8. | 7 | 22 | 0000 | | 8 | 23 | 0000 | | 9 | 6 | 0000 | aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 4 of 12 | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | | 0000 | | 16 | | 0000 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 56 ERROR: Unable to insert 56 into Hash Table: Hopscotch Hash Failed HOPSCOTCH HASH MENU:
  • 9. 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 3 Enter positive integer value to search for in Hopscotch Hash Table: 39 39 found at position 6. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 2 Enter positive integer value to delete from Hopscotch Hash Table: 6 6 deleted from position 9. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | | 0000 | | 1 | | 0000 | | 2 | | 0000 | | 3 | | 0000 | | 4 | | 0000 | | 5 | 5 | 1110 |
  • 10. | 6 | 39 | 0010 | | 7 | 22 | 0000 | | 8 | 23 | 0000 | | 9 | | 0000 | | 10 | | 0000 | aemalki aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 5 of 12 | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | | 0000 | | 16 | | 0000 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash
  • 11. Table: 19 19 inserted at position 2. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 50 50 inserted at position 16. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 56 56 inserted at position 8. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | | 0000 | | 1 | | 0000 | | 2 | 19 | 1000 |
  • 12. | 3 | | 0000 | | 4 | | 0000 | | 5 | 5 | 1111 | | 6 | 39 | 0001 | | 7 | 22 | 0000 | | 8 | 56 | 0000 | | 9 | 23 | 0000 | | 10 | | 0000 | | 11 | | 0000 | aemalki aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 6 of 12 | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | | 0000 | | 16 | 50 | 1000 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table
  • 13. 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: -5 Enter positive integer value to insert into Hopscotch Hash Table: 16 ERROR: Unable to insert 16 into Hash Table: Linear Probe Failed HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 5 Program terminated by user... BONUS OPPORTUNITY: • For those students who have completed all the requirements, you may attempt to add circular functionality to the linear probe (i.e., not just to the end of the table) for up to 15 bonus points. • SAMPLE OUTPUT for BONUS showing circular table rolling over (input in bold): $ ./a.out HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash
  • 14. Table: 16 16 inserted at position 16. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 15 15 inserted at position 15. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value aemalki aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 7 of 12 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash
  • 15. Table: 33 33 inserted at position 0. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | 33 | 0000 | | 1 | | 0000 | | 2 | | 0000 | | 3 | | 0000 | | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 | | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | 15 | 1000 | | 16 | 16 | 1100 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table
  • 16. 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 50 50 inserted at position 1. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | 33 | 0000 | | 1 | 50 | 0000 | | 2 | | 0000 | aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 8 of 12 | 3 | | 0000 | | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 |
  • 17. | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | 15 | 1000 | | 16 | 16 | 1110 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 32 32 inserted at position 16. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | 33 | 0000 | | 1 | 50 | 0000 | | 2 | 16 | 0000 | | 3 | | 0000 |
  • 18. | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 | | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | 15 | 1100 | | 16 | 32 | 0111 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value aemalki aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 9 of 12 4 - Output Table 5 - Exit Program
  • 19. Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 67 ERROR: Unable to insert 67 into Hash Table: Hopscotch Hash Failed HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | 33 | 0000 | | 1 | 50 | 0000 | | 2 | 16 | 0000 | | 3 | | 0000 | | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 | | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | | 0000 | | 15 | 15 | 1100 | | 16 | 32 | 0111 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value
  • 20. 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 14 14 inserted at position 14. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | 33 | 0000 | | 1 | 50 | 0000 | | 2 | 16 | 0000 | aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019 10 of 12 | 3 | | 0000 |
  • 21. | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 | | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | 14 | 1000 | | 15 | 15 | 1100 | | 16 | 32 | 0111 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 31 ERROR: Unable to insert 31 into Hash Table: Hopscotch Hash Failed HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+
  • 22. | 0 | 33 | 0000 | | 1 | 50 | 0000 | | 2 | 16 | 0000 | | 3 | | 0000 | | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 | | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | 14 | 1000 | | 15 | 15 | 1100 | | 16 | 32 | 0111 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value aemalki aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019
  • 23. 11 of 12 4 - Output Table 5 - Exit Program Enter operation to perform: 1 Enter positive integer value to insert into Hopscotch Hash Table: 17 17 inserted at position 3. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | 33 | 0001 | | 1 | 50 | 0000 | | 2 | 16 | 0000 | | 3 | 17 | 0000 | | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 | | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | 14 | 1000 | | 15 | 15 | 1100 | | 16 | 32 | 0111 |
  • 24. +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 2 Enter positive integer value to delete from Hopscotch Hash Table: 32 32 deleted from position 16. HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 4 HOPSCOTCH HASH TABLE: +------------------+ | # | item | hop | +------------------+ | 0 | 33 | 0001 | | 1 | 50 | 0000 | | 2 | 16 | 0000 | aemalki aemalki CSCE 3110 Data Structures & Algorithms Summer 2019
  • 25. 12 of 12 | 3 | 17 | 0000 | | 4 | | 0000 | | 5 | | 0000 | | 6 | | 0000 | | 7 | | 0000 | | 8 | | 0000 | | 9 | | 0000 | | 10 | | 0000 | | 11 | | 0000 | | 12 | | 0000 | | 13 | | 0000 | | 14 | 14 | 1000 | | 15 | 15 | 1000 | | 16 | | 0111 | +------------------+ HOPSCOTCH HASH MENU: 1 - Insert Value 2 - Delete Value 3 - Search Value 4 - Output Table 5 - Exit Program Enter operation to perform: 5 Program terminated by user... SUBMISSION: • You will electronically submit your source code file(s) and a README file where you explain all of the information for the grader to properly grade your program (e.g., how to compile it, how to run it, etc.) to the Project 3 dropbox in Canvas by the due date. Also submit a screen-shot (or use the “script”
  • 26. command) of your program running. Be sure to include your name in each program file and in the README file. • Note that this program should be done individually. The program will be checked using a code plagiarism tool against other solutions, so please be sure that all work submitted is your own. aemalki aemalki aemalki aemalki aemalki ASS 6 In this Assignment, you will build on the knowledge you gained while completing the Discussion Board requirement. At this time, you will perform a textual analysis of protest songs. To complete this Assignment, you must choose one protest song from the 1960s and one protest song from within the last 5 years. For each song, locate at least three themes and then compare/contrast these themes. The Assignment must be four
  • 27. pages long, including the title page, content pages, and works cited page. 1. Choose one protest song from the 1960s and one protest song from today. Locate the lyrics for each song and provide the complete lyrics in an appendix to your Assignment or in a separate file. Cite the songs and lyrics using APA style. 2. Locate at least three themes in each song. Compare and contrast these themes using quotes from the lyrics to illustrate each theme. 3. Summarize your findings in a concluding paragraph. Rubric: 6 Grade: Grading Criteria A: 81-90 points · Essay identifies at least three themes in each chosen protest song. · Essay provides thoughtful commentary to illustrate each theme. · Identified themes are clearly compared and contrasted between the two time periods. · Essay is clearly written and meets the posted length requirements. • Complete song lyrics are included and cited using APA style. B: 72-80 points · Essay identifies at least three themes in each chosen protest song. · Essay provides thoughtful commentary to illustrate each theme. · Essay provides a weak comparison of the themes across the
  • 28. two time periods. · One of the three required parts is missing from the essay. · Essay meets the posted length requirements. · Complete song lyrics are included and cited using APA style. C: 63-71 points · Essay identifies less than three themes in each chosen protest song. · Essay provides little commentary to illustrate each theme. · One or more of the three required parts is missing from the essay. · Essay does not meet posted length requirements. · Essay uses no supporting sources. · Essay does not include complete song lyrics. D: 54-62 points · Essay is only partially on topic, lacks originality, and vaguely. mentions the assignment topic. · Essay does not meet posted length requirements. F: 0-53 points · Essay is off topic and lacks originality. · Essay makes little or no references to assignment questions. · Essay does not meet posted length requirements. · Essay contains extensive plagiarized text= graded as zero. 5% or up to 8 points are deducted from your assignment for grammatical, incorrect or missing APA formatting and citations, typographic or word usage problems.