Professional Documents
Culture Documents
(https://swayam.gov.in) (https://swayam.gov.in/nc_details/NPTEL)
abhijithmallya@gmail.com
(course)
Course
outline Week 2 Quiz
The due date for submitting this assignment has passed.
How does an Due on 2023-02-08, 23:59 IST.
NPTEL Score: 8/10=80%
online
course
work? () Assignment submitted on 2023-02-07, 08:26 IST
All questions carry equal weightage. You may submit as many times as you like within the
Week 1 : deadline. Your final submission will be graded.
Introduction
() 1) Having collected Aadhaar information for each SIM card, a government agency 2 points
wants to check that all the Aadhaar numbers entered in SIM card applications are actually valid,
Week 1 : by comparing SIM card applications against the list of registered Aadhaar numbers. Which of the
Analysis of following is likely to be the best strategy for this?
algorithms ()
Use a nested loop. For each SIM card application S, and for each Aadhaar number A,
Week 1 Quiz check if the Aadhaar number listed in S is the same as A.
() Sort the SIM card applications and use binary search to speed up the process.
Sort the registered Aadhaar numbers and use binary search to speed up the process.
Week 2 :
Sort both the SIM card applications and registered Aadhaar numbers and merge the two
Searching
lists.
and sorting
() Yes, the answer is correct.
Score: 2
Feedback:
Week 2 Quiz
The nested loop is the correct naive strategy. Sorting the list in the inner loop allows us to use
()
binary search instead of a nested loop, so the complexity reduces from O(n2) to O(n log n).
Quiz: Week 2 Accepted Answers:
Quiz Sort the registered Aadhaar numbers and use binary search to speed up the process.
(assessment?
name=133) 2) Suppose our aim is to sort an array in descending order. Which of the following 2 points
statements is true?
https://onlinecourses.nptel.ac.in/noc23_cs16/unit?unit=39&assessment=133 1/4
3/26/23, 11:28 AM Design and analysis of algorithms - - Unit 6 - Week 2 Quiz
Week 2 Input in ascending order is worst case for both selection sort and insertion sort.
Programming Input in ascending order is worst case for insertion sort but not for selection sort.
Assignment Input in descending order is worst case for both selection sort and insertion sort.
()
Input in ascending order is worst case for selection sort but not for insertion sort.
https://onlinecourses.nptel.ac.in/noc23_cs16/unit?unit=39&assessment=133 2/4
3/26/23, 11:28 AM Design and analysis of algorithms - - Unit 6 - Week 2 Quiz
Week 6 [("Uday",60),("Tariq",71),("Shweta",71),("Salma",72).("Sunita",85),("Brinda",85)]
Programming [("Uday",60),("Shweta",71),("Tariq",71),("Salma",72),("Sunita",85),("Brinda",85)]
Assignment [("Uday",60),("Tariq",71),("Shweta",71),("Salma",72),("Brinda",85),("Sunita",85)]
()
[("Uday",60),("Shweta",71),("Tariq",71),("Salma",72),("Brinda",85),("Sunita",85)]
Week 7
Programming
Assignment
()
Week 8:
Linear
Programming
and Network
Flows ()
Week 8:
Intractability
()
Week 8 Quiz
()
Text
Transcripts ()
Books ()
Download
Videos ()
Problem
Solving
Session ()
Lecture
Material ()
https://onlinecourses.nptel.ac.in/noc23_cs16/unit?unit=39&assessment=133 3/4
3/26/23, 11:28 AM Design and analysis of algorithms - - Unit 6 - Week 2 Quiz
https://onlinecourses.nptel.ac.in/noc23_cs16/unit?unit=39&assessment=133 4/4