Recursion in Java (AP Computer Science A)

Assessment
•
Patrick Ferrer
•
Computers
•
9th - 12th Grade
•
98 plays
•
Medium
Student preview

10 questions
Show all answers
1.
MULTIPLE CHOICE
30 sec • 1 pt
When the base case is met, which of these could be returned?
[Enclosing method: recursiveFunc(int n)]
2.
MULTIPLE CHOICE
20 sec • 1 pt
The capabilities of a recursive function can typically be recreated by . . .
3.
MULTIPLE CHOICE
45 sec • 1 pt
For which of these operations is a recursive function practical?
4.
MULTIPLE CHOICE
30 sec • 1 pt
What is a recursive function?
5.
MULTIPLE CHOICE
30 sec • 1 pt
Which of these is NOT an acceptable header for a recursive function?
6.
MULTIPLE CHOICE
45 sec • 1 pt
Assuming n is initialized as an integer variable with a positive value, what will be printed?
7.
MULTIPLE SELECT
2 mins • 1 pt
The Collatz Conjecture states that, in sequence, taking any integer and, if even, halving the result/integer and, if odd, tripling and adding 1 to the result/integer continuously will eventually end up as 1.
Which of the above methods properly recreates the conjecture?
Select all answers that apply.
(Click the picture to enlarge.)
8.
MULTIPLE SELECT
2 mins • 1 pt
Which of the above methods correctly implements indirect recursion?
Select all answers that apply.
9.
MULTIPLE SELECT
2 mins • 1 pt
Which of the above methods correctly implements direct recursion?
Select all answers that apply.
10.
MULTIPLE SELECT
1 min • 1 pt
Which of the above methods could result in a stack overflow exception for certain values of n?
Select all answers that apply.
Explore all questions with a free account
Similar Resources on Quizizz
10 questions
Python Code Review

•
9th Grade
10 questions
LUA Test

•
9th Grade - University
12 questions
Enumeration and Recursion

•
11th Grade - University
15 questions
Recursion in Java

•
11th - 12th Grade
10 questions
Python_10 câu

•
10th Grade
12 questions
C++ Recursion

•
9th - 12th Grade
10 questions
Functions in C++

•
9th - 12th Grade
12 questions
Вказівник

•
12th Grade - University
Popular Resources on Quizizz
5 questions
Brain Teasers

•
KG - University
37 questions
Math STAAR Review

•
4th Grade
12 questions
Earth Day

•
4th Grade
25 questions
STAAR REVIEW - SCIENCE

•
5th Grade
20 questions
Science STAAR Review! 23-24

•
5th Grade
20 questions
Reading Comprehension

•
5th Grade
20 questions
Types of Credit

•
9th - 12th Grade
23 questions
Math STAAR Review

•
4th Grade