Here is the starter code for this lab: Lab 5 Starter Code
You will need to fill in the blocks under "Lab 5: Algorithmic Complexity" and submit this to Gradescope.
The following blocks are graded:
O(1).
O(N)
.
The autograder contains hidden tests to ensure students do not hardcode their code to pass the tests.
To receive full credit, open the starter code and click on the Autograder pallete in the top left area of Snap.
Once you have finished coding the above blocks, click on the "run autograder" block. This will run the
tests for each block locally. If you pass each test locally and did not hardcode your code to pass the tests,
you should also receive full credit for your Gradescope submission.
Let's play a number-guessing game (you have already seen this before).
Between your partner and yourself, decide who will be the guesser and the the picker. The picker chooses a number between 1 and 50, privately. The guesser's role is to determine what the number is, and to that end asks the picker questions with the only possible answers being "yes" or "no".
The guesser should try two different strategies to playing this game:
Play several times. The picker should pick a wide variety of numbers, while the guesser should use each strategy alternately.
As you play each game, think about the ways in which one
strategy is better than the other. Which strategy would be better if, say,
the guessing game involved numbers from 1 to 1000? From 1 to a
million? From 1 to 3?
Are there other strategies you can think of?