Recursion_DS

Recursion_DS

University

7 Qs

quiz-placeholder

Similar activities

Machine Learning (Introduction)

Machine Learning (Introduction)

University

10 Qs

INTRODUCCION A LA PROGRAMACION

INTRODUCCION A LA PROGRAMACION

6th Grade - University

10 Qs

Let's Play Together

Let's Play Together

University - Professional Development

10 Qs

basic computer design

basic computer design

University

10 Qs

Network Management Week 14

Network Management Week 14

University

10 Qs

How Safe are you? (Disclaimer: I do not own these questions)

How Safe are you? (Disclaimer: I do not own these questions)

University

10 Qs

QUIZZ 1 : DATABASE FUNDAMENTALS

QUIZZ 1 : DATABASE FUNDAMENTALS

University

10 Qs

AMS - Aula 03

AMS - Aula 03

University

10 Qs

Recursion_DS

Recursion_DS

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Jeena KK

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

void printNumbers(int n) {

if (n <= 0) {

return;

}

printNumbers(n - 1);

cout << n << " ";

}

int main() {

printNumbers(5);

return 0;

}

5 4 3 2 1

1 2 3 4 5

1 1 1 1 1

5 5 5 5 5

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

void printNumbers(int n) {

if (n <= 0) {

return;

}

cout << n << " ";

printNumbers(n - 1);

}

int main() {

printNumbers(5);

return 0;

}

5 4 3 2 1

1 2 3 4 5

1 1 1 1 1

5 5 5 5 5

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

int mystery(int n) {

if (n <= 0) {

return 0;

}

return (n % 10) + mystery(n / 10);

}

int main() {

cout << mystery(12345) << endl;

return 0;

}

15

10

14

9

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the time complexity of a recursive algorithm with a recurrence relation of T(n) = T(n/2) + O(1)?

O(n log n)

O(n)

O(log n)

O(1)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the time complexity of a recursive algorithm with a recurrence relation of T(n) = T(n/2) + n?

O(n log n)

O(n)

O(log n)

O(1)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the time complexity of a recursive algorithm with a recurrence relation of T(n) = T(n-1) + O(1)?

O(n log n)

O(n)

O(log n)

O(1)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the time complexity of a recursive algorithm with a recurrence relation of T(n) = T(n-1) + n?

O(n log n)

O(n^2)

O(log n)

O(n)

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?

Discover more resources for Computers