Professional Documents
Culture Documents
A1194041789 63616 14 2022 Cse230daaca2k21ch
A1194041789 63616 14 2022 Cse230daaca2k21ch
A1194041789 63616 14 2022 Cse230daaca2k21ch
of Algorithms
Course Code- CSE 230
Continuous Assessment-II
Important Guidelines
2. It is mandatory to attempt all questions of the assignment in your own handwriting on A4 size
sheets/pages with a blue color ink pen. Any other mode of attempt (typed or printed codes or table) except
handwritten/drawn will not be accepted/considered as valid submission(s) under any circumstances.
3. Every attempted sheet/page should carry clear details of student such as Name, Registration number, Roll
number, Question number and Page number. The page numbers should be written clearly on the bottom of
every attempted sheet in a prescribed format as: for page 1; Page 1 of 4, for page 2; Page 2 of 4, for page 3;
Page 3 of 4 and for page 4; Page 4 of 4, in case your assignment/document is of 4 pages.
5. Refrain from indulging into plagiarism as copy cases will be marked zero.
6. This Document contains multiple sets of papers. The allocation sheet is also attached in the CA file.
All the students are advised to attempt the Set allocated to him/her.
7. If any student found indulge in malpractices like plagiarism from internet or classmates,
attempting wrong set of question paper or any other, will be awarded with zero (0) marks in CA.
Design and Analysis of Algorithms (CSE-230) CA-II
Set-1 Max Marks-30
B) In which condition you will prefer selection sort? Explain time complexity analysis of Selection sort.
[5]
3. A) A card player arranges his card when he picks the card one by one and put at the appropriate place.
Now he is having 5 cards (The card Numbers:6, 5, 4, 7 and 2) in his hand. Write a java program to sort the
cards using an appropriate sorting algorithm. [5]
B) Explain why other sorting algorithms can’t be used in this scenario. [5]
Design and Analysis of Algorithms (CSE-230) CA-2
Set-2 Max Marks-30
1. A) Write a note on Calculating the complexity of Selection Sort from its algorithm.[5]
B) Why Selection sort is not adopts Divide-and-Conquer paradigm, compare it with any sorting
algorithm which adopts Divide-and-Conquer paradigm? [5]
2. Can you sort the Given array in O(n logn) time and O(1) memory. if Yes? Give proper detailed
justification in support of your choice.
Output:[1,2,3,4,5] [10]
3. A) Write a program to Sort the list 415, 213, 700, 515, 712, 715 using concept of Quicksort.
[5]
B) State and explain the recurrence for worst case of Quicksort. [5]
Design and Analysis of Algorithms (CSE-230) CA-II
Set-3 Max Marks-30
1. State and explain any sorting algorithm which adopts Divide-and-Conquer paradigm using an example.
[10]
2. A) Consider the following array, what is the status of the array after each pass when we use insertion
sort. [5]
3. A) Write a java program to sort the list P, O, W, E, R in alphabetical order by selection sort.
[5]
2. Consider the following array, Write an algorithm for returning an array after sorting it in ascending order
with O(n logn) time complexity.
2. Consider a list arranged in an increasing order, Compare the time complexities with relevant justification
if such input case get processed by Merge Sort and Quick Sort. [10]
b) Mention Best, Average and Worst-Case running time complexity of it. [5]
Design and Analysis of Algorithms (CSE-230) CA-2
2. Do we have the possibility to get O(n^2) in case of Merge Sort, Yes or No? Give proper detailed
justification in support of your choice. [10]