**NPTEL Introduction to algorithms and analysis **This course provides an introduction to mathematical modeling of computational problems. It covers the common algorithms, algorithmic paradigms, and data structures used to solve these problems.

**NPTEL Introduction to algorithms and analysis** is a MOOC course offered by IIT Kharagpur on the NPTEL platform. The course emphasizes the relationship between algorithms and programming and introduces basic performance measures and analysis techniques for these problems. The course is developed by **Prof. Sourav Mukhopadhyay** is an Associate Professor of, Department of Mathematics at the Indian Institute of Technology Kharagpur. He has completed his B.Sc (Honours in Mathematics) in1997 from the University of Calcutta, India.

ALL UG STUDENTS**INTENDED AUDIENCE:****Requirements/Prerequisites:**NIL**INDUSTRY SUPPORT:**All compaines or industry

**CRITERIA TO GET A CERTIFICATE**

Students have to score Average assignment score = 25% of the average of the best 8 assignments out of the total 12 assignments given in the course.

Exam score = 75% of the proctored certification exam score out of 100 Final scores = Average assignment score + Exam score

Students will be eligible for CERTIFICATE ONLY IF AVERAGE ASSIGNMENT SCORE >=10/25 AND EXAM SCORE >= 30/75. If any of the 2 criteria are not met, the student will not get the certificate even if the Final score >= 40/100, we will help you in Introduction to algorithms and analysis ASSIGNMENT answers

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 10 ANSWERS:-

Contents

- 1 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 10 ANSWERS:-
- 2 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 9 ANSWERS:-
- 3 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 8 ANSWERS:-
- 4 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 7 ANSWERS:-
- 5 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 5 ANSWERS:-
- 6 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 4 ANSWERS:-
- 7 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 3 ANSWERS:-
- 8 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 2 ANSWERS:-
- 9 NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 1 ANSWERS:-

**Q1.**

**Answer:-** **c**

**Q2.**

**Answer:-** **b**

**Q3.**

**Answer:-** **b**

**Q4.**

**Answer:-** **b**

**Q5.**

**Answer:-** **c**

**Q6.**

**Answer:-** **c**

**Q7.**

**Answer:-** **b**

**Q8.**

**Answer:-** **a**

**Q9.**

**Answer:-** **a**

**Q10.**

**Answer:-** **a**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 9 ANSWERS:-

**Q1.**

**Answer:-** **d**

**Q2.**

**Answer:-** **b**

**Q3.**

**Answer:-** **c**

**Q4.**

**Answer:-** **c**

**Q5.**

**Answer:-** **d**

**Q6.**

**Answer:-** **a**

**Q7.**

**Answer:-** **c**

**Q8.**

**Answer:-** **d**

**Q9.**

**Answer:-** **a**

**Q10.**

**Answer:-** **b**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 8 ANSWERS:-

**Q1.**

**Answer:-** **c**

**Q2.**

**Answer:-** **d**

**Q3.**

**Answer:-** **b**

**Q4.**

**Answer:-** **b**

**Q5.**

**Answer:-** **b**

**Q6.**

**Answer:-** **c**

**Q7.**

**Answer:-** **b**

**Q8.**

**Answer:-** **d**

**Q9.**

**Answer:-** **b**

**Q10.**

**Answer:-** **a**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 7 ANSWERS:-

**Q1.**

**Answer:-** **d**

**Q2.**

**Answer:-** **d**

**Q3.**

**Answer:-** **c**

**Q4.**

**Answer:-** **c**

**Q5.**

**Answer:-** **d**

**Q6.**

**Answer:-** **d**

**Q7.**

**Answer:-** **b**

**Q8.**

**Answer:-** **d**

**Q9.**

**Answer:-** **c**

**Q10.**

**Answer:-** **b**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 5 ANSWERS:-

**Q1.**

**Answer:-** **c**

**Q2.**

**Answer:-** **b**

**Q3.**

**Answer:-** **c**

**Q4.**

**Answer:-** **a**

**Q5.**

**Answer:-** **b**

**Q6.**

**Answer:-** **b**

**Q7.**

**Answer:-** **a**

**Q8.**

**Answer:-** **c**

**Q9.**

**Answer:-** **c**

**Q10.**

**Answer:-** **a**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 4 ANSWERS:-

**Q1.**

**Answer:-** **d**

**Q2.**

**Answer:-** **d**

**Q3.**

**Answer:-** **b**

**Q4.**

**Answer:-** **d**

**Q5.**

**Answer:-** **b**

**Q6.**

**Answer:-** **b**

**Q7.**

**Answer:-** **d**

**Q8.**

**Answer:-** **d**

**Q9.**

**Answer:-** **a**

**Q10.**

**Answer:-** **b**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 3 ANSWERS:-

**Q1.** Choose the most appropriate option.

Which of the following option is correct?

Statement 1: The worst case of quick sort is when the input array is in sorted order.

Statement 2: The worst case of quick sort is when the input array is in reverse sorted order.

**Answer:-** **c**

**Q2.** What is the auxiliary space complexity of randomized quick sort?

**Answer:-** **c**

**Q3.** A machine needs a minimum of 200 sec to sort 1024 elements by quick sort. The minimum time needed to sort 512 elements will be approxi mately………..

**Answer:-** **a**

**FOR WEEK 4 ANSWERS JOIN US ON TELEGRAM WILL NOTIFY THERE**

**Q4.** Statement 1: If we choose the pivot randomly, then the time complexity of quick sort never exceeds n log n. Statement 2: Randomized quick sort is an in-place sort.

**Answer:-** **c**

**Note:- WE NEVER PROMOTE COPYING AND We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students to reference, so we urge do your assignment on your own.**

**Q5.** What is the time complexity of Build Heap operation? Build Heap is used to build a max(or min) binary heap from a given array.

**Answer:-** **b**

**Q6.** Consider a binary max-heap implemented using an array. Which one of the following array represents a binary max-heap?

**Answer:-** **c**

**Q7.** In a max heap containing n numbers, the smallest element can in time

**Answer:-** **a**

**Q8.** A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is

**Answer:-** **a**

**Q9.** Any decision tree that can sort n elements must have height 22(log n). The above statement is …

**Answer:-** **b**

**Q10.** Consider any array representation of an n element binary heap where the elements are stored from index 1 to index n of the array. For the element stored at index i of the array (in), the index of the parent

**Answer:-** **d**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 2 ANSWERS:-

**Q1.** Master’s theorem is used for……….

**Answer:-** **a**

**Q2.** What is the time complexity of matrix multiplied recursively by Divide and Conquer Method?

**Answer:-** **c**

**Q3.** Find the pivot element from the given input using median-of-three par titioning method. 8, 1, 4, 9, 6, 3, 5, 2, 7, 0.

**Answer:-** **c**

**Q4.** Under what case of Master’s theorem will the recurrence relation of binary search fall?

**Answer:-** **b **

**Q5.** Let an be the number of n-bit strings that do NOT contain two con secutive 1’s. Which one of the following is the recurrence relation for an?

**Answer:-** **b**

**Q6.** Suppose we are sorting an array of eight integers using quick sort, and we have just finished the first partitioning with the array looking like this: 62 15 21 77 79 112 61 80

**Answer:-** **b**

**FOR WEEK 3 ANSWERS JOIN US ON TELEGRAM WILL NOTIFY THERE**

**Q7.** In Strassen’s matrix multiplication, what is the formula to calculate the element present in second row, first column of the product matrix? (Here the notations are defined as in the lecture note)

**Answer:-** **d**

**Q8.** We can solve any recurrence by using Master’s theorem. The above statement is……

**Answer:-** **b**

**Q9.** In quick sort of the following numbers, if the pivot is chosen as the first element, what will be the order of the numbers after the partition function? Assume we are sorting in increasing order (13, 18, 8, 10, 21, 7, 2, 32, 6, 19).

**Answer:-** **b**

**Q10.** What is the result of the recurrences which fall under first case of Master’s theorem, let the recurrence be given by T(n)=aT(n/b) + f(n) and f(n) = nº?

**Answer:-** **a**

## NPTEL Introduction to algorithms and analysis ASSIGNMENT WEEK 1 ANSWERS:-

**Q1.** Which of the given option provides the increasing order of asymptomatic complexity of functions f1 = n^2

**Answer:- ** **D**

**Q2.** For the best case input, the running time of an insertion sort algorithm

**Answer:- ** **A**

**Q3.** Which of the following examples represent the worst case input for an insertion sort?

Answer:- **B **

**Q4.** Which of the following option is FALSE?

(a) In insertion sort, after m passes through the array, the first m elements are in sorted order.

(b) In insertion sort, after m passes through the array, the first m elements are the m smallest elements in the array.

(c) Insertion sort is stable and it sorts In-place.

(d) On an array of size n, insertion sort consists of n – 1 iteration.

**Answer:- ** **B**

**Q5.** Consider the array {6,4,8,1,3} apply the insertion sort to sort the array. Consider the cost associated with each iteration is 25 rupees, what is the total cost of the insertion sort when element 1 reaches the first position of the array?

**Answer:- B**

**Q6.** Consider that we apply insertion sort to sort the array [27,19,33,15,4]. What will be the order of the elements after 3rd iteration?

**Answer:- ** **C**

**Q7.** Let W(n) and A(n) denote respectively, the worst-case and average-case running time of an algorithm executed on an input of size n. Which of the following is ALWAYS TRUE?

**Answer:- C**

**NOTE:- ****IF THERE IS ANY CHANGE IN ANSWERS OF Introduction to algorithms and analysis ASSIGNMENT ** **answers** **WILL UPDATE BEFORE LAST DATE AND NOTIFY ON TELEGRAM OR WHATSAPP. SO KINDLY JOIN US, CLICK ON THE BELOW IMAGE AND JOIN US.**

**Q8. **What is the worst case time complexity of merge sort?

**Answer:- A** , WILL UPLOAD WEEK 2 ANSWERS HERE FIRST

**Q9.** Given two sorted list of size m and n respectively. The number of comparisons needed in the worst case by the merge sort algorithm will BE

**Answer:- d**

**Q10.** Compared to Insertion sort, Merge Sort will take least time when all elements of input array are identical.

The above statement is…….

**Answer:- b**

**Also check :- Internship oppurtinites**

**Note:- We do not claim 100% surety of answers, these answers are based on our sole knowledge, and by posting these answers we are just trying to help students, so we urge do your assignment on your own.**