Murder Mystery Tree Lab:, Slides of Advanced Computer Programming

The Munsters are a well-respected family living in Transylvania. There's Herman and Lily, the parents, and their two teenage children, Eddie and Marilyn.

Typology: Slides

2021/2022

Uploaded on 09/27/2022

gangesha
gangesha 🇺🇸

4.6

(20)

238 documents

1 / 9

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
A
B
C
D
E
F
G
H
I
J
O
R
S
T
U
V
0
1
2
3
4
5
6
7
8
9
14
17
18
19
20
21
Murder Mystery Tree Lab:
(Due Mon, Apr 19, but I hope you can finish it within the lab period!)
Munster House Link:
The Munsters are a well-respected family living in Transylvania. There’s Herman and Lily, the parents, and their
two teenage children, Eddie and Marilyn. Grandpa Munster also lives with them.
One day the police are called to their home at 1313 Mockingbird Lane to solve a murder. However, the
circumstances are a bit unusual. Apparently Grandpa Munster was at a Costume Party, and came home to find
everyone gone and an hysterical maid. In piecing together her story, Grandpa, with a sinking heart, realizes that
the maid has seen one member of the family being murdered. She also saw the murderer and their accomplice
wrapping the body up and throwing it over the cliff into the rocky ocean below. Apparently the 4th member of the
family witnessed the whole thing through a window, and has now fled the premises in fear for their life.
So, to summarize, one of the Munsters has been murdered, one Munster is the murderer, one Munster is an
accomplice, and one Munster is a witness.
Grandpa has figured out who each one is, but can’t bear to just turn in his family members. So to assuage his
conscience, he has placed clues in various rooms throughout the Munster mansion, and each room has a key code.
(Because this factors into the maid’s eye-witness account, it is important to know that Herman and Eddie
habitually wear black, and Lily and Marilyn are never caught wearing anything but shades of green.)
Your job, as the detective on the case, is to figure out each key code to enter each room, gather the clues, and
then figure out who is the murderer, who was the accomplice, who was the witness, and who was murdered
before the murderer and their accomplice flee the country!
(The codes must be entered into the google form on canvas to unlock the next room and clue)
Good luck.
/***************************************************************************************/
Notes: At the bottom of each page is the alphabet, in order, along with a corresponding number. In computer
science, a is less than z.
Equally, when ordering strings, apple is less than zoo. While string order is based on the ascii character
representation, the easiest way to remember string order is to think of what page a word would occur on in the
dictionary. So:
“aardvark” would occur on page 1,
whereas “main” might occur on page 350, whereas
“zymurgy” (yep, it’s a word. I googled ‘words that begin with zy’ and it popped up. It has something to do
with homebrewing) would occur on, say, page 1024.
That means aardvark < main < zymurgy
/**************************************************************************/
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Murder Mystery Tree Lab: and more Slides Advanced Computer Programming in PDF only on Docsity!

A B C D E F G H I J K L M n O P Q R S T U V W X Y Z

Murder Mystery Tree Lab:

(Due Mon, Apr 19, but I hope you can finish it within the lab period!)

Munster House Link:

The Munsters are a well-respected family living in Transylvania. There’s Herman and Lily, the parents, and their

two teenage children, Eddie and Marilyn. Grandpa Munster also lives with them.

One day the police are called to their home at 1313 Mockingbird Lane to solve a murder. However, the

circumstances are a bit unusual. Apparently Grandpa Munster was at a Costume Party, and came home to find

everyone gone and an hysterical maid. In piecing together her story, Grandpa, with a sinking heart, realizes that

the maid has seen one member of the family being murdered. She also saw the murderer and their accomplice

wrapping the body up and throwing it over the cliff into the rocky ocean below. Apparently the 4th member of the

family witnessed the whole thing through a window, and has now fled the premises in fear for their life.

So, to summarize, one of the Munsters has been murdered, one Munster is the murderer, one Munster is an

accomplice, and one Munster is a witness.

Grandpa has figured out who each one is, but can’t bear to just turn in his family members. So to assuage his

conscience, he has placed clues in various rooms throughout the Munster mansion, and each room has a key code.

(Because this factors into the maid’s eye-witness account, it is important to know that Herman and Eddie

habitually wear black, and Lily and Marilyn are never caught wearing anything but shades of green.)

Your job, as the detective on the case, is to figure out each key code to enter each room, gather the clues, and

then figure out who is the murderer, who was the accomplice, who was the witness, and who was murdered

before the murderer and their accomplice flee the country!

(The codes must be entered into the google form on canvas to unlock the next room and clue)

Good luck.

Notes: At the bottom of each page is the alphabet, in order, along with a corresponding number. In computer

science, a is less than z.

Equally, when ordering strings, apple is less than zoo. While string order is based on the ascii character

representation, the easiest way to remember string order is to think of what page a word would occur on in the

dictionary. So:

  • “aardvark” would occur on page 1,
  • whereas “main” might occur on page 350, whereas
  • “zymurgy” (yep, it’s a word. I googled ‘words that begin with zy’ and it popped up. It has something to do

with homebrewing) would occur on, say, page 1024.

That means aardvark < main < zymurgy

A B C D E F G H I J K L M n O P Q R S T U V W X Y Z

Code 1: The recursion solutions:

(Note: I think this is the most time-consuming clue. Please try to solve without running it so you can see if you can

follow recursion!)

Solve the following recursion problems, then use the answers (strung together with no spaces or quotes or double

quotes or even commas) to enter the library with the first clue!)

The array is 'p','u','p','p','y'

And the len is 5

What is returned from calling recf1 with (that last thing “” is a blank, or empty string)

recf1(arr,0,len,"");

string recf1 ( char arr[], int ind, int len, string s) {

if (ind == len) {

return s; // what is returned, here?

else {

if (arr[ind] != 'p') {

return (recf1(arr,ind+1,len,s + arr[ind]));

else {

return (recf1(arr,ind+1,len,s+'m'));

Answer: ______________________________________

Recursion problem 2 (string together this answer after the above answer, again, no spaces, quotes, commas, etc.)

The string is"hroesdurbuhm";

The len is 11

What is returned from calling recf2 with:

recf2(s,””,len);

string recf2 (string s, string t, int len) {

if (len < 0) {

return t;

else {

if (len%2 == 1) {

return (recf2(s,t+s[len],len-1));

else {

return (recf2(s,t,len-1));

A B C D E F G H I J K L M n O P Q R S T U V W X Y Z

Code 2: To enter the dilapidated parlor to get clue 2,

Part 1: Solve the following traversal problems

Given the Tree, do a post-order traversal:

Answer: _______________________

Part 2: Given the following Tree, do a pre-order traversal of the nodes:

Answer: ______________________

Part 3: Do an in-order traversal of the following tree:

A B C D E F G H I J K L M n O P Q R S T U V W X Y Z

Answer: __________________________

Part 4: Now use letters 4 and 7 from the first traversal (assuming the first letter is letter 1), letters 3, 3

(again) and then 4 from the second traversal, and letter 4 from the third traversal strung together (no

spaces, all lower-case letters) as the code to enter the next room: ________________

Code 2 : _________________________(Enter this into the google form Murder Mystery

Munster House to unlock the next clue)

Code 3: Answer the following true-false questions:

1) The worst case run time to find in a Linked List is:

A) O(n^2 )

B) O(n log 2 n)

C) O(2n)

D) O(n)

E) O(log 2 n)

F) O(1)

G) None of the above

2) The worst case run time to find in an array is:

A) O(1)

B) O(n^2 )

C) O(n log 2 n)

D) O(2n)

E) O(n)

F) O(log 2 n)

G) None of the above

3) The worst case run time to find in a binary search tree is:

A) O(n)

B) O(1)

C) O(n^2 )

D) O(n log 2 n)

E) O(2n)

F) O(log 2 n)

G) None of the above

4) The worst case run time to find in a balanced binary search tree is:

A) O(n log 2 n)

B) O(2n)

C) O(n)

D) O(log 2 n)

E) O(1)

F) O(n^2 )

A B C D E F G H I J K L M n O P Q R S T U V W X Y Z

Part 2: Do a post-order traversal.

Answer: _______________________________________________

Part 3: Now, in the order of the post-order traversal, take the second letter (so in ethereal, the first letter is e, and

the second is t) of each word and string them together, no spaces, all lower case, no commas. That is your next

code: ________________

Code4: ______________________________(Enter this into the google form Murder Mystery

Munster House to unlock the next clue)

Code 5: Create an AVL tree out of the following words:

Altercation, greed, identify, madness, sicken, ominous, woe, petrified, raving

Answer:

Part 2: Do a pre-order traversal of this tree.

Answer: _____________________________________________________________

Now string together the 3rd letter (so in altercation, the 3rd letter is t) of each word (rules apply: no spaces, all

lower case, no commas). Use this code to enter the 5th^ room:

A B C D E F G H I J K L M n O P Q R S T U V W X Y Z

Code 5: __________________________-(Enter this into the google form Murder Mystery

Munster House to unlock the next clue)

Code 6: Part 1) Answer each of the following questions about the number of levels

1) If you have a balanced binary search tree with 36 nodes, how many levels will it have?

2) If you have a balanced binary search tree with 68 nodes, how many levels will it have?

3) If you have a balanced binary search tree with 15000 nodes, how many levels will it have?

4) If you have an Unbalanced binary search tree with 18 nodes, at most how many levels will it have?

T or F: The following is a balanced binary search tree:

Part 2: For each answer 1-4, find the corresponding letter to you answer (at the bottom of the page). String

together the letters (all lower case, no spaces, or commas, etc.) along with the lower case version of your answer

to question 5, and that is the code for the room with the final clue!

Answer Part 1: ______________________________

Answer Part 2: ______________________________

Code 6: __________________________________(Enter this into the google form Murder Mystery

Munster House to unlock the next clue)