COCAT - DAA
Quiz
•
Computers, Education
•
University - Professional Development
•
Practice Problem
•
Hard
Balakrishnan D
Used 19+ times
FREE Resource
Enhance your content in a minute
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
An image processing application begins with two n×n matrices A and B. The first phase of preprocessing the inputs takes O(n2) steps for each of A and B. The second step involves a convolution of A and B to yield a new matrix C in time O(n3). This is followed by an edge detection phase that takes times O(n2) for matrix C. What is the most accurate and concise description of the complexity of the overall algorithm?
O(n2)
O(n3)
O(n2+n3)
O(n5)
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
We are trying to determine the worst case time complexity of a library function that is provided to us, whose code we cannot read. We test the function by feeding large numbers of random inputs of different sizes. We find that for inputs of size 300 and 3.000, the function always returns well within one second, but for inputs of size 30,000 it sometimes takes about 1 second and for inputs of size 300,000 it sometimes takes 1-2 minutes. What is a reasonable conclusion we can draw about the worst case time complexity of the library function? (You can assume, as usual, that a typical desktop PC performs 109 basic operations per second.)
O(n log n)
O(n2)
O(n3)
O(n3 log n)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose f(n) is 2n3+4n+5 and g(n) is 7n5 + 5n3 + 12. Let h(n) be a third, unknown function. Which of the following is not possible.
h(n) is O(f(n)) and h(n) is also O(g(n))
h(n) is O(g(n)) but h(n) is not O(f(n))
h(n) is O(f(n)) but h(n) is not O(g(n))
h(n) is not O(f(n)) and h(n) is also not O(g(n))
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If T(n) is O(n2 √ n) which of the following is false?
T(n) is O(n2 log n)
T(n) is O(n3)
T(n) is O(n3 log n)
A. T(n) is O(n4)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times is the comparison i >= n performed in the following program?
int i = 200, n = 80;
main(){
while (i >= n){
i = i-2;
n = n+1;
}
}
40
41
42
43
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is not true?
Quicksort and merge sort are both examples of divide and conquer algorithms.
If we randomly choose a pivot element each time, quicksort will always terminate in time O(n log n).
For every fixed strategy to choose a pivot for quicksort, we can construct a worst case input that requires time O(n2).
If we could find the median in time O(n), quicksort would have worst case complexity O(n log n).
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In a min-heap, what is the most accurate description of the worst-case complexity of the operation find_max that reports the value of the largest element in the heap, without removing it?
O(1)
O(log n)
O(n)
O(n log n)
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
Matriz de crecimiento/participación
Quiz
•
University
20 questions
Fibra Óptica, Medios Inalámbricos, Cableado Estructurado
Quiz
•
Professional Development
20 questions
DI (EM24) - Diseño de Contenidos (T8)
Quiz
•
University - Professi...
20 questions
IT 101 - Quiz 3
Quiz
•
University
20 questions
NACOS Kahoot Session II
Quiz
•
University
20 questions
COA_QUIZ_UNIT I
Quiz
•
University
21 questions
CPA MS-Office Hotkeys Quiz
Quiz
•
8th Grade - Professio...
20 questions
Les émotions
Quiz
•
Professional Development
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
Discover more resources for Computers
10 questions
Identifying Phishing Emails Quiz
Quiz
•
Professional Development
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
14 questions
2019 Logos
Quiz
•
Professional Development
9 questions
Principles of the United States Constitution
Interactive video
•
University
18 questions
Realidades 2 2A reflexivos
Quiz
•
7th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
25 questions
Integer Operations
Quiz
•
KG - University
