What value does function mystery return when called with a value of 4?
int mystery ( int number )
{
If ( number <= 1 )
return 1;
else
return number * mystery( number – 1 );
}
.
DAA-Quiz1
Quiz
•
Computers
•
University
•
Hard
Amit Chaurasia
FREE Resource
10 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
What value does function mystery return when called with a value of 4?
int mystery ( int number )
{
If ( number <= 1 )
return 1;
else
return number * mystery( number – 1 );
}
.
2.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
At most, how many comparisons are required to search a sorted vector of 1023 elements using the binary search algorithm?
3.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
The height of the shortest binary search tree of size n is .........................
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
1/2 n2 – 3n = O (n2).
Find the value of constant n0 if c =1, for this relation to hold, if found valid.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The running time of your program will depend upon:
1. The algorithm, The input
2. Your implementation of the algorithm in a programming language
3. The compiler you use, The OS on your computer and Your computer hardware
4. Maybe other things: other programs on your computer
1 False and 2 True
3 False and 4 true
All true
All false
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Give asymptotic tight bounds for the followings using master method.
T(n) = 9T(n/4) + n2
n
n2
n2logn
None of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
•Give asymptotic tight bounds for the followings using master method.
T(n) = 9T(n/3) + 2n2 + n/3
n2
n2logn
n3
None of the above
10 questions
AdvancedProgramming_intro
Quiz
•
University
10 questions
Analysis of Algorithms
Quiz
•
University
15 questions
Knowledge Knockout[Quiz Round](2nd-4th years)
Quiz
•
University
13 questions
DS UNIT-2 TEST-2
Quiz
•
University
10 questions
DAA Quiz 1
Quiz
•
University
13 questions
time and space complexity
Quiz
•
University
15 questions
Data Structures Activity - 1
Quiz
•
University
7 questions
Complexity Analysis Station [1]
Quiz
•
University
10 questions
Chains by Laurie Halse Anderson Chapters 1-3 Quiz
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
12 questions
Multiplying Fractions
Quiz
•
6th Grade
30 questions
Biology Regents Review #1
Quiz
•
9th Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review: Structure & Function
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University
16 questions
Chapter 8 - Getting Along with your Supervisor
Quiz
•
3rd Grade - Professio...
6 questions
Railroad Operations and Classifications Quiz
Quiz
•
University
71 questions
Logos
Quiz
•
3rd Grade - University
8 questions
Mali - Geography
Quiz
•
University