ShmoopTube
Where Monty Python meets your 10th grade teacher.
Search Thousands of Shmoop Videos
Computer Science Videos 112 videos
Just as you move your furniture into a new house before spending the night, you’ve got to spend a little time setting up your environment when yo...
Doubles and ints. At first glance, it may look like this video will be about baseball and football statistics. But they're actually computer scienc...
AP Computer Science: Classes and Objects Drill 1, Problem 1. Which of the following is a correct {/* Implementation */} for the isInsect method?
AP Computer Science 1.3 Standard Algorithms 173 Views
Share It!
Description:
AP Computer Science 1.3 Standard Algorithms. How many times will mystery be called for mystery(4), including the initial call?
Transcript
- 00:00
Thank you We sneak and here's your smug dooz your
- 00:05
featuring rijker jh in defined in the dictionary as now
- 00:10
Riker asians hope that helps How many times will mystery
- 00:14
he called for mystery for including the initial call Thinking
- 00:21
helps returns All right And here your potential answers bunching
Full Transcript
- 00:25
up All right ready Pause and go I will Taking
- 00:30
a peek at the mystery function It looks like it'll
- 00:32
recur over itself If n does not equal zero one
- 00:38
or two All right well we're being asked how many
- 00:41
times mystery will get called if we give in the
- 00:45
value of floor like scooby doo All right well there's
- 00:49
really No better way for us to figure it out
- 00:52
And the old patent paper So from the top mystery
- 00:55
for that's one call if any cool Zero No no
- 00:59
If n equals one uh nope If n equals two
- 01:03
new well so we'll move along to this else case
- 01:07
and return mystery and minus one or three plus two
- 01:11
times mystery and minus two Better known as two Yeah
- 01:17
well that's Two more calls counting All right Well let's
- 01:22
take the low hanging fruit and handle that call to
- 01:24
mystery too It's an easy one that will simply return
- 01:28
to after having been caught by the if and equals
- 01:31
two statements The mystery three however won't get caught by
- 01:34
the ef zero one or two statements and we'll have
- 01:37
us calling mystery again two more times So we have
- 01:40
mystery and minus one which is to now will return
- 01:44
a two We've got that again that if statement catches
- 01:48
any shoes that it sees and mystery and minus two
- 01:52
is one and little return Ah one when caught by
- 01:56
the and equals one statement so looks like ryker shin
- 01:59
is over and we won't be making any more calls
- 02:03
to mystery making the answer five Well we sure are 00:02:07.235 --> [endTime] glad that's over and over and over over Yeah
Related Videos
AP Computer Science 1.2 GridWorld Case Study and APIs. What is the direction of the actor?
AP Computer Science 1.4 Standard Algorithms. How many times will mystery be called for mystery(n) for n > 1?
AP Computer Science 2.3 Classes and Objects. Which of the following is correct implementation of the Country class?
AP Computer Science 3.4 Inheritance, Abstraction, and Polymorphism. Which of the following will satisfy the conditional if statement for boo, str,...
AP Computer Science 4.2 Standard Algorithms. What kind of algorithm is the following?