The process of defining a problem (or the solution to a problem) in terms of (a simpler version of) itself is known as:
C++ Recursion

Quiz
•
Science, Computers, Mathematics
•
8th - 12th Grade
•
Medium
Natalia Fumero
Used 172+ times
FREE Resource
12 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
repetition
recursion
reapparition
reversing
2.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Which of the following is the best definition of a recursive method?
A method that iterates itself exactly 5 times.
A method that invokes itself by name within the method.
A method that will never iterate infinitely.
A method that cannot be called more than once.
3.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Recursion is similar to which of the following?
if-else
switch-case
loops
none of the above
4.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Name the condition at which the recursive method will stop calling itself.
Base case
Worst Case
Best Case
None of the above
5.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The following function finds the factorial of any number
int factorial(int n)
{
if(n == 0 || n == 1) return 1;
return n * factorial(n-1);
}
What would calling factorial(4) output?
24
16
8
64
6.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
The following function finds the factorial of any number
int factorial(int n)
{
if(n == 0 || n == 1) return 1;
return n * factorial(n-1);
}
What would calling factorial(2) output?
12
2
0
22
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
Make the following function return the following number in the fibonacci sequence
int fibo(int n)
{
if(n == 0 || n == 1) return n;
return _________________;
}
fib (n-1)+fib (n-2)
fibo(n-1)+fibo(n-2)
fibo(n*2)
fibo(n+1)+fibo(n+2)
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Programming

Quiz
•
1st - 10th Grade
10 questions
Operators in C

Quiz
•
9th - 12th Grade
15 questions
Struktur Kontrol Perulangan, Array, dan Function (Bahasa C)

Quiz
•
10th Grade
14 questions
Python Objects and Recursion

Quiz
•
10th Grade
15 questions
Informatika X Pemrograman C

Quiz
•
10th Grade
12 questions
Divide et Impera

Quiz
•
11th Grade - University
16 questions
Loops

Quiz
•
5th - 12th Grade
11 questions
C++ Functions

Quiz
•
6th - 8th Grade
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade
Discover more resources for Science
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade