wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Recursion Practice, Recursion Practice, Recursion Practice...

Total questions: 10

Worksheet time: 38mins

Name
Class
Date
1.
What is returned as a result of the call mystery(4,6)?
a)
2
b)
3
c)
4
d)
1
2.
Which of the following is the best definition of a recursive method?
a)
A method that iterates itself exactly 5 times.
b)
A method that invokes itself by name within the method.
c)
A method that will never iterate infinitely.
d)
A method that cannot be called more than once.
3.
What is the returned value of recMethod(5)?
a)
68
b)
70
c)
75
d)
82
4.
What is printed as a result of the call stringMaker("COMPSCI")?
a)
COMPSCI
COMPSC
COMPS
COMP
COM
CO
C
b)
COMPSCI
OMPSCI
MPSCI
PSCI
SCI
CI
I
c)
CO
COM
COMP
COMPS
COMPSC
COMPSCI
d)
C
CO
COM
COMP
COMPS
COMPSC
COMPSCI
5.
Will recursion(5) iterate infinitely? 
a)
Yes
b)
No
6.
What value is returned as a result of the call mysterious(x)?
a)
x * (x+1)
b)
2x
c)
2(x-1)
d)
x+1
7.
What is the returned value of digits(-24684)?
a)
20
b)
18
c)
24
d)
23
8.
Which expression represents the result of calling recurs(11,4)? 
a)
x + y
b)
x * y
c)
xy-2
d)
yx+2
9.
Will recursive(50) iterate infinitely?
a)
Yes
b)
No
10.
What is the value of concatenation("Recursion")?
a)
Rcrion
b)
 Rcrio
c)
Rron
d)
Recson