C++ Recursion

C++ Recursion

8th - 12th Grade

12 Qs

quiz-placeholder

Similar activities

Focus Monday 12.11

Focus Monday 12.11

7th - 8th Grade

10 Qs

Arduino

Arduino

7th - 9th Grade

15 Qs

Ulangan Gerak dan Gaya

Ulangan Gerak dan Gaya

8th Grade

15 Qs

TOÁN 8_KHỞI ĐỘNG MỞ ĐẦU VỀ PHƯƠNG TRÌNH

TOÁN 8_KHỞI ĐỘNG MỞ ĐẦU VỀ PHƯƠNG TRÌNH

8th Grade

10 Qs

Números enteros y Expresiones algebraricas SEGUNDO

Números enteros y Expresiones algebraricas SEGUNDO

6th - 8th Grade

15 Qs

EFECTE HIVERNACLE I CANVI CLIMÀTIC

EFECTE HIVERNACLE I CANVI CLIMÀTIC

7th - 10th Grade

17 Qs

Year 10 Review

Year 10 Review

9th - 11th Grade

10 Qs

Tema 7 Trigonometría

Tema 7 Trigonometría

10th Grade

15 Qs

C++ Recursion

C++ Recursion

Assessment

Quiz

Science, Computers, Mathematics

8th - 12th Grade

Practice Problem

Medium

CCSS
HSF.IF.A.3

Standards-aligned

Created by

Natalia Fumero

Used 172+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

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

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

Tags

CCSS.HSF.IF.A.3

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)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?