
Recursion_DS
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Jeena KK
Used 1+ times
FREE Resource
Enhance your content in a minute
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)
Similar Resources on Wayground
10 questions
Quiz 1
Quiz
•
University
10 questions
Bài 25 tin 10
Quiz
•
9th Grade - University
10 questions
Función CONTAR
Quiz
•
KG - Professional Dev...
10 questions
Unguided transmission media
Quiz
•
University
12 questions
Python Quiz 1.4
Quiz
•
University
10 questions
Logika Fuzzy
Quiz
•
University
11 questions
Latex
Quiz
•
University
10 questions
Tree and Planar Graph
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University
