Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
29 views
2022 Algorithm
DU Question Paper
Uploaded by
Animesh Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save 2022_Algorithm For Later
Download
Save
Save 2022_Algorithm For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
29 views
2022 Algorithm
DU Question Paper
Uploaded by
Animesh Kumar
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save 2022_Algorithm For Later
Carousel Previous
Carousel Next
Save
Save 2022_Algorithm For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 6
Search
Fullscreen
Gb. Copy t4)acfor [bis question paper contains 10 printed pages.) Your Roll Nes eonnsn Se. No. af Question Paper: 1143 a Unique Paper Code sasaraoi Name of the Paper Design and Analysis of Algorithns Name of the Course: BS. (I) Computer Science Semester wv Duration: 3 Hours Manion Marks : 75 instructions fo 1 Write your Roll No: on the top immediatly on receipt of this question paper. 2, Question No. £ is compulsory 3. Auenmpt any four of Questions Nes. 2 to 8 1. (0) Consider the recursive algorithm as follows 19 of Insertion sort, In order to sort Afi a], we recursively sort ATL orl] and then insert Af] into the sorted array A[] ml]. Write a recurrence for the running time of this algorithm. 8 Pro.1143 2 (6) What ate the m lements in a binary heap of height BY. 2) Jima and maximum number of (©) Which of the following algorithms are stable Insertion sort, Queksort? Justify with te help of sn example. ® (@) What are these key factors that decide whether Dynamic Programming is applicable for sn ‘optimization problem or not? e (©) “The minimum spanning tree im a graph is not always unique" Justify. Give a graph with $ nodes that has two different minimum spanning tres. @ ( Would you use BFS 10 find the shortest path between two nodes én 2 weighted graph with arbitrary edge weights? Justify your answer sith the help of a graph having at least $ Vertices and at least 7 edges. ° (2) “Counting sort is 4 comparison sort algoriths,” Yes or No. Justiy your answer using the input A=64,3,2,4,1,5,2,43> @ (5) A priority queue can be implemented in two Aitferent ways using min-heap and using singly linked list in which elements are stored in sorted 1143 5 alder (Smaller values indicates higher priority) Compare the time complexity of following operations when performed on two differe implementations of priority queue. (1) Finding the highest priority element (2) Deleting the highest priority element (9) Increase the priovity of a certain element © 0) ind posible Topological sons ofthe piven directed graph, Give any four ey i) Give the worst ease for the merge algorithm to merge two sorted strays AL. 4], Blloom) (where n=k+m) and give the total number of comparisons in the worst case (in terms of 1) Merge the two sorted arrays A = [3, 7,9, 12, 14] and B= [2, 5, 6, 10] using morge algorithm. How many number of comparisons are done by the lgorthm in the above extmple? o pro.1143 4 (8) Consider the Interval Scheduling problem wherein, We ate given a resource and a set of requests cach having a start time and @ finish time, The foal is to maximize the aumiber of requests Scheled, Show that dhe following greedy siratcxy does not give an optiznal solution for the above problem. Greedy strategy: Select the request with fewest ‘number of incompatible requests, ° 2. (a) Peofessor William claims that the Qn fg») lower bound for sorting n numbers docs not apply to his ‘machine, The conttol flow of a program on his ‘machine can split three ways after a single comparison of two elements of the array a,:9, The three ways are 9, < 8) 4 = a, of a > a, Show that the professor is wrong by proving that ‘he numberof three-way comparisons requited to sort m elements is O(w len), 6 () Suppose you have aa algorthts fo find meslian of fr elements of an unsorted ray in O(n) time ia the worst ease, Now consider an implementation ‘of Quicksort where you fits find median using the above algorithm, then use median a pivot ‘What wil be the time complesityof this modified 1143 5 (Quicksort” Write down the recurrence relation to justify your time complexity (Median of elements is the element whose rank is 1/2 if mis even and itis (ntl 2 if mis bd. o 3. (a) llustrate the operation of BUILD -MAX -H EAP on the array A <4, 3,17, 10, 28, 19, 6 12, 7 Wirite down the total number of comparisons done bby BUILD -MAX -t1 EAP, © (©) Consider the following recursive relation for 0-1 knapsack problem, Iw ew, then OPTi,w) = OPT(-1,¥) else OPT, W) = max(OPT(-1,w), ¥, + OPTI, > where OPT(,w) denote the value of the optimal solution using a subset of items (1,2yi} with rmakimum allowed weight w. ¥; fe the cost of ith stem Fl the missing vale, What is the cunning time of the recursive Implementation of the shove recurrence? Justify Give memoized recursive algorith for the above problem, Explain how does it improve the running time? oy pro.1143 6 4 (@) Give an algorithm to sort a integers in the range 0 to n? 1 in O(n) time. Justify it’s time complexity ® (©) Suppote we use randomized select to select the sminimum elemeat of the arrey A= <4,2,1, 7,8, 12, 3, 0, 9, S, 10>. Describe a sequence of partitions that resull in a worst case performance of randomized sele. ® () Suppose an input to the bucket sort algorithm is sot uniformly distributed. What willbe the effoet of this condition on the running time of the algorithm? Justify @ (2) A Shopkeeper has n emply boxes and M number of balls Let (KK one Kn} denote the wumber of balls that each box can stor, Given Mand (Ky, Ky Kn}, describe a ‘greedy algorithm whick determines the minimum ‘number of boxes needed 10 store the balls. Give time complexity of the algorithm. o () Design 2 O(¥i"1E) time algorithm 1 find whether 2 given undirected graph is.bipartte (where V is the set of vertices, E ie the set of edges of the sap. ” 1143 1 (6) Give space requirements of adjacency matrix and adjacency ist represestation having m edges snd vertices. e) 6 (a) "Prim’s algorithm only inelude an edge in the “Minimum Spanning tree when i is justfie by the Cut propery." State the Cut Property. Justify the above statement on the given graph showing cute iv all the intermediate steps © () Suppose divide and conquer approach is ured hy fan algorithm to solve a problem on the input of size m. The algorithm divides the problem into f number of smaller instznces, exch of which is Yb the size ofthe original problem. It solves prlem reersivey on these smaller instances and combine theit solutions to construct the final Pro,1143 8 solution ofthe brignal problem. Let Gin) denotes the cost of dividing the problem into smaller instances and Fin) denotes the eost of combining the solutions. Write the recurrence relation to find the running time of the algorithm. Give G(n} and Fn) for Hoth Ouicksort sad Mergesort algorithm, —() (6) Let G be a graph with m vertices and m edges. What is the upper bound on the running time of Depth Firat Search on G, where G is represented as an adjacency matrix? @ [a) A boat fas 9 capaci sms each having ceria weight Wi hit The goal isto select che set of ‘tem thatthe boat should carry so that it could carry maximum load(ie. sum of the weights of selected items should be maximum) within capacity €, © ta carry load. There are si number of sssociated wi Design « Polynomial time Dydumie Programming algorithm for the problem. Derive the time complenty of the above algorithm, Ran this algorithm on the sample iastanee given below to find the optimal solution, 6 1143 9 Capacity of the boat = 4g Hens ‘Weights tem ake Tem 2 ke Them? 1s () Suppose we perform a sequence of » operations tm a data structure in whieh the th operation costs iF Fi am exact power of 2, and 1 otherwise, Use aggregate analysis to determine the amortized cost per operation, o 8.) The following graph represents sework of siports that are connected 10 each other. Each edge epresets the distinee (in multiples of 1000 mies) ‘covered by the igh 0 travel from one aiport to another and vertices represents the airports. A. flight steets from wirport and has to reach Aestinaions c,d and e: Run an efficiet algorithm to Find the route taken by the fligh to exch co is destinations in minimum possible time, Show all the imermodiate steps taken by the algoritha, Also drive its time eompenty o Pro.1143 10 () There are x Jobs where gach job stats at time 5, and finishes at time fi, There isa profit associated ‘with each job. The goal isto find a subset of nos: ‘overlapping jobs such that the sum of their profits Given below is the instance of the problem: cb Namba [Stat Time | Fash tne] Prot w 0 o oer o 6. @ job 1 a 30 obs 3 5 0 ob 5 7 30 obs 5 3 = Dobe 7 3 w ve a Dynamic programing the shove problem, Explain the recurrence relation sed inthe solution, tive solution for Show that the “Optimal solution to the ahove problem contains within it optimal solution 4 its subproblems.” With reference to the above example © (1500)
You might also like
Analysis of Algorithms CS 477/677: Midterm Exam Review Instructor: George Bebis
PDF
No ratings yet
Analysis of Algorithms CS 477/677: Midterm Exam Review Instructor: George Bebis
25 pages
Algos Qpaper 2022
PDF
No ratings yet
Algos Qpaper 2022
6 pages
algo pyq
PDF
No ratings yet
algo pyq
16 pages
July 2022 End Sem DAA
PDF
No ratings yet
July 2022 End Sem DAA
4 pages
DAA Previous Paper
PDF
No ratings yet
DAA Previous Paper
14 pages
DAA Assignment1
PDF
No ratings yet
DAA Assignment1
8 pages
DAA SET a CT 1 Answer Key
PDF
No ratings yet
DAA SET a CT 1 Answer Key
7 pages
小考20181026 (第一次期中考)
PDF
No ratings yet
小考20181026 (第一次期中考)
8 pages
AD I Practice Questions
PDF
No ratings yet
AD I Practice Questions
11 pages
CS2006
PDF
No ratings yet
CS2006
2 pages
QP VTU With Ans 1A PDF
PDF
No ratings yet
QP VTU With Ans 1A PDF
19 pages
CT1-Answer key Set A DAA.docx
PDF
No ratings yet
CT1-Answer key Set A DAA.docx
7 pages
Daa Two Mark Questions
PDF
No ratings yet
Daa Two Mark Questions
9 pages
Du Daa - QP 2022
PDF
No ratings yet
Du Daa - QP 2022
5 pages
Jntuworld: R09 Set No. 2
PDF
No ratings yet
Jntuworld: R09 Set No. 2
6 pages
ADA IMP Questions With Solution For GTU
PDF
No ratings yet
ADA IMP Questions With Solution For GTU
63 pages
Computer Algorithm
PDF
No ratings yet
Computer Algorithm
59 pages
Daa Question Papers
PDF
No ratings yet
Daa Question Papers
9 pages
CS702. 2011-Sol
PDF
No ratings yet
CS702. 2011-Sol
13 pages
CS3CO13-IT3CO06 Design and Analysis of Algorithms
PDF
No ratings yet
CS3CO13-IT3CO06 Design and Analysis of Algorithms
4 pages
DAA All-Quizzes
PDF
No ratings yet
DAA All-Quizzes
9 pages
Subject: Algorithm Analysis and Design: Question Bank
PDF
No ratings yet
Subject: Algorithm Analysis and Design: Question Bank
10 pages
D&C BhagabanUnit - II - 1
PDF
No ratings yet
D&C BhagabanUnit - II - 1
45 pages
Daa
PDF
No ratings yet
Daa
17 pages
DAA Solution All Years Previous Year Paper
PDF
No ratings yet
DAA Solution All Years Previous Year Paper
79 pages
2011 Daa End-Regular
PDF
No ratings yet
2011 Daa End-Regular
4 pages
CS6402 - Daa 16marks With Answers
PDF
No ratings yet
CS6402 - Daa 16marks With Answers
20 pages
btech-cse-4-sem-design-and-analysis-of-algorithms-105402-2022
PDF
No ratings yet
btech-cse-4-sem-design-and-analysis-of-algorithms-105402-2022
4 pages
Abhijeet Daa Solution All Years Previous Year Paper (1)
PDF
No ratings yet
Abhijeet Daa Solution All Years Previous Year Paper (1)
81 pages
Lecture Notes 5 Divide and Conquer Algorithms
PDF
No ratings yet
Lecture Notes 5 Divide and Conquer Algorithms
42 pages
Ignou Mcs 031 Solved Paper
PDF
0% (2)
Ignou Mcs 031 Solved Paper
7 pages
CMP3501 Analysis of Algorithms: Lecture Notes 5 - Divide and Conquer Algorithms
PDF
No ratings yet
CMP3501 Analysis of Algorithms: Lecture Notes 5 - Divide and Conquer Algorithms
38 pages
Ce 209 Daa 05 2014
PDF
No ratings yet
Ce 209 Daa 05 2014
3 pages
Solutions To Set 140
PDF
No ratings yet
Solutions To Set 140
18 pages
AD3351 - DAA SET B-Answer Key
PDF
No ratings yet
AD3351 - DAA SET B-Answer Key
5 pages
Time: 3 Hours Total Marks: 70
PDF
No ratings yet
Time: 3 Hours Total Marks: 70
16 pages
DAA FJ1_Set B Key
PDF
No ratings yet
DAA FJ1_Set B Key
9 pages
Question
PDF
No ratings yet
Question
10 pages
DAAQB Test1
PDF
No ratings yet
DAAQB Test1
3 pages
DAA Final Examination 2003en
PDF
No ratings yet
DAA Final Examination 2003en
10 pages
2017 Algorithm
PDF
No ratings yet
2017 Algorithm
5 pages
U2 - Decrease and Conqure
PDF
No ratings yet
U2 - Decrease and Conqure
38 pages
Analysis and Design of Algorithms
PDF
No ratings yet
Analysis and Design of Algorithms
2 pages
Week 5
PDF
No ratings yet
Week 5
37 pages
DAA Important Questions-1
PDF
No ratings yet
DAA Important Questions-1
10 pages
Daa Assignment
PDF
No ratings yet
Daa Assignment
12 pages
Midterm Exam Review
PDF
No ratings yet
Midterm Exam Review
25 pages
Analysis of Algorithms CS 477/677: Midterm Exam Review Instructor: George Bebis
PDF
No ratings yet
Analysis of Algorithms CS 477/677: Midterm Exam Review Instructor: George Bebis
25 pages
Midterm Exam Review
PDF
No ratings yet
Midterm Exam Review
25 pages
CS502 GQ DEC 2020, MCS of Virtuallians
PDF
100% (2)
CS502 GQ DEC 2020, MCS of Virtuallians
41 pages
Design & Analysis of Algorithms Mcs 031 Assignment Free
PDF
No ratings yet
Design & Analysis of Algorithms Mcs 031 Assignment Free
15 pages
Algorithms
PDF
No ratings yet
Algorithms
14 pages
2-Divide and Conquer Approach
PDF
No ratings yet
2-Divide and Conquer Approach
162 pages
Ada All Question Shitanshu Jain
PDF
No ratings yet
Ada All Question Shitanshu Jain
6 pages
Introduction To Algorithm Design and Analysis: A, A,, A A ', A ',, A ' Such That A ' A ' A
PDF
No ratings yet
Introduction To Algorithm Design and Analysis: A, A,, A A ', A ',, A ' Such That A ' A ' A
21 pages
Analysis and Design of Algorithms
PDF
No ratings yet
Analysis and Design of Algorithms
2 pages
3rd Mid Sem Pyqs
PDF
No ratings yet
3rd Mid Sem Pyqs
14 pages