DAA-2020 Week 01 Assignment 01
DAA-2020 Week 01 Assignment 01
DAA-2020 Week 01 Assignment 01
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
Course
outline Week 1 Quiz
How does an The due date for submitting this assignment has passed. Due on 2020-02-12, 23:59 IST.
NPTEL online As per our records you have not submitted this assignment.
course work?
All questions carry equal weightage. You may submit as many times as you like within the deadline.
Week 1 : Your final submission will be graded.
Introduction
1) An image processing application begins with two n×n matrices A and B. The first phase of 2 points
2
preprocessing the inputs takes O(n ) steps for each of A and B. The second step involves a convolution of
Week 1 : Analysis
A and B to yield a new matrix C in time O(n3). This is followed by an edge detection phase that takes
of algorithms
times O(n2) for matrix C. What is the most accurate and concise description of the complexity of the
overall algorithm?
Week 1 Quiz
O(n2)
Quiz : Week 1
Quiz O(n3)
(assessment? O(n2+n3)
name=93)
O(n5)
Week 2 : No, the answer is incorrect.
Searching and Score: 0
sorting Feedback:
When there are multiple phases in sequence, the largest of the phases dominates the overall complexity.
Week 2 Quiz Here the second phase is O(n3) and the first and third phases are O(n2).
Accepted Answers:
O(n3)
Week 2
Programming 2) We are trying to determine the worst case time complexity of a library function that is 2 points
Assignment 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
Week 3 : Graphs 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
Week 3 Quiz case time complexity of the library function? (You can assume, as usual, that a typical desktop PC
performs 109 basic operations per second.)
https://onlinecourses.nptel.ac.in/noc20_cs27/unit?unit=92&assessment=93 1/3
02/07/2020 Design and analysis of algorithms - - Unit 4 - Week 1 Quiz
Week 7: Dynamic 40
Programming 41
42
Week 7 Quiz
43
Week 7 No, the answer is incorrect.
Programming Score: 0
Assignment Feedback:
After 40 iterations, i is 200-80=120 and n is 80+40=120. At this point, i==n so the 41st iteration succeeds
Week 8: Linear The next test of the while condition fails and exits the loop. Hence, overall the while condition is checked
Programming 42 times.
and Network Accepted Answers:
Flows 42
https://onlinecourses.nptel.ac.in/noc20_cs27/unit?unit=92&assessment=93 2/3
02/07/2020 Design and analysis of algorithms - - Unit 4 - Week 1 Quiz
https://onlinecourses.nptel.ac.in/noc20_cs27/unit?unit=92&assessment=93 3/3