You will be given an input with a large series of lines (all strings). The first line consists of 2 integer values, x and y, which will tell you the number of following lines (evidence) and the size of the hash table respecitvely. Following that will be x lines with three numbers: a, b, and c. a represents an integer to be inserted into the hash table, b represents the first potential hash position, and c represents a second valid hash position. If all integers a can be added to the hash, return the string "Aha!" (no quotations). Else, return the string "Drat!".

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter17: Markov Chains
Section17.7: Work-force Planning Models
Problem 4P
icon
Related questions
Question
100%

please don't use chegg

You are a up-and-coming detective at the ACPD (Avian Cuculinae Police Department) for Nestville City, and have just been placed on the case for the Cuckoo Killer. You arrive at three new crime scenes and have a plethora of potential evidence to collect, but with little time until they strike again you need to be absolutely sure the only crime scenes you investigate were done by the Cuckoo Killer. Thankfully, they leave a signature mark on the scene: precisely reorganizing the environment into integers and hash functions able to produce valid Cuckoo Hashes (a lucky break!).

You will be given an input with a large series of lines (all strings). The first line consists of 2 integer values, x and y, which will tell you the number of following lines (evidence) and the size of the hash table respecitvely. Following that will be x lines with three numbers: a, b, and c. a represents an integer to be inserted into the hash table, b represents the first potential hash position, and c represents a second valid hash position. If all integers a can be added to the hash, return the string "Aha!" (no quotations). Else, return the string "Drat!".

2. (40 pts) You are a up-and-coming detective at the ACPD (Avian Cuculinae Police
Department) for Nestville City, and have just been placed on the case for the Cuckoo
Killer. You arrive at three new crime scenes and have a plethora of potential evidence to
collect, but with little time until they strike again you need to be absolutely sure the only
crime scenes you investigate were done by the Cuckoo Killer. Thankfully, they leave a
signature mark on the scene: precisely reorganizing the environment into integers and
hash functions able to produce valid Cuckoo Hashes (a lucky break!).
You will be given an input with a large series of lines (all strings). The first line consists
of 2 integer values, x and y, which will tell you the number of following lines (evidence)
and the size of the hash table respecitvely. Following that will be x lines with three
numbers: a, b, and c. a represents an integer to be inserted into the hash table, b
represents the first potential hash position, and c represents a second valid hash position.
If all integers a can be added to the hash, return the string "Aha!" (no quotations). Else,
return the string "Drat!".
Input 1: 55
141
Case 1:
Output 1: Aha!
230
312
413
520
Input 2: 6 8
131
Case 2:
Output 2: Drat!
251
325
431
5 23
61 2
Input 3: 99
136
Case 3:
Output 3 unknown, solve the case!
284
362
429
513
692
749
813
945
Transcribed Image Text:2. (40 pts) You are a up-and-coming detective at the ACPD (Avian Cuculinae Police Department) for Nestville City, and have just been placed on the case for the Cuckoo Killer. You arrive at three new crime scenes and have a plethora of potential evidence to collect, but with little time until they strike again you need to be absolutely sure the only crime scenes you investigate were done by the Cuckoo Killer. Thankfully, they leave a signature mark on the scene: precisely reorganizing the environment into integers and hash functions able to produce valid Cuckoo Hashes (a lucky break!). You will be given an input with a large series of lines (all strings). The first line consists of 2 integer values, x and y, which will tell you the number of following lines (evidence) and the size of the hash table respecitvely. Following that will be x lines with three numbers: a, b, and c. a represents an integer to be inserted into the hash table, b represents the first potential hash position, and c represents a second valid hash position. If all integers a can be added to the hash, return the string "Aha!" (no quotations). Else, return the string "Drat!". Input 1: 55 141 Case 1: Output 1: Aha! 230 312 413 520 Input 2: 6 8 131 Case 2: Output 2: Drat! 251 325 431 5 23 61 2 Input 3: 99 136 Case 3: Output 3 unknown, solve the case! 284 362 429 513 692 749 813 945
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Fundamentals of Information Systems
Fundamentals of Information Systems
Computer Science
ISBN:
9781337097536
Author:
Ralph Stair, George Reynolds
Publisher:
Cengage Learning