C++ Recursion

C++ Recursion

8th - 12th Grade

12 Qs

quiz-placeholder

Similar activities

โครงสร้างภายในของโลก

โครงสร้างภายในของโลก

8th Grade

10 Qs

SNC2L Chp  4 Support Your Opinion

SNC2L Chp 4 Support Your Opinion

10th Grade

10 Qs

حاسب 2

حاسب 2

10th Grade

15 Qs

Latihan

Latihan

12th Grade

15 Qs

Kiểm tra giữa kỳ 1 Tin 8

Kiểm tra giữa kỳ 1 Tin 8

8th Grade

15 Qs

Formatif Sistem Koordinat Kartesius

Formatif Sistem Koordinat Kartesius

8th Grade

10 Qs

Himpunan 7a

Himpunan 7a

11th - 12th Grade

10 Qs

Funzioni (base)

Funzioni (base)

12th Grade

14 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)

Create a free account and access millions of resources

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?