NPTEL Design and analysis of algorithms Assignment 2 Answers 2024

NPTEL Design and analysis of algorithms Assignment 2 Answers 2024

Hello learners In this article we are going to discuss NPTEL Design and analysis of algorithms Assignment 2 Answers. All the Answers provided below to help the students as a reference, You must submit your assignment with your own knowledge and use this article as reference only.

About the course:-

This course will cover basic concepts in the design and analysis of algorithms.

  • Asymptotic complexity, O() notation
  • Sorting and search
  • Algorithms on graphs: exploration, connectivity, shortest paths, directed acyclic graphs, spanning trees
  • Design techniques: divide and conquer, greedy, dynamic programming
  • Data structures: heaps, union of disjoint sets, search trees
  • Intractability

NPTEL Design and analysis of algorithms Assignment 2 Answers 2024:

1. Arrays A and B each contain N integers arranged in a random sequence. We want to check if A and B have any entries in common. Which of the following would be the most efficient algorithm, asymptotically?

Answer :- d

2. Suppose our aim is to sort an array in ascending order. Which of the following statements is true?

Answer :- d

3. Suppose we want to sort an array in descending order and we implement quicksort so that we always choose the last element in the array as the pivot element. Assume that the input is a permutation of {1, 2, …, n}. Which of the following would definitely be a worst case permutation of this input for this implementation of quicksort?

Answer :- b

4. Which of the following statements is not true?

Answer :- b

5. We have a list of pairs [(“Ashwin”,69),(“Sumati”,87),(“Tanuja”,69),(“Brinda”,87), (“Shabana”,72),(“Vijay”,60)], where each pair consists of a student’s name and his/her marks in a course. We sort these pairs in ascending order of marks. Which of the folllowing corresponds to a stable sort of this input?

Answer :- d