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)
4 views
2-1 Algorithm 19 Batch
question
Uploaded by
soccho66
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save 2-1_Algorithm_19_batch For Later
Download
Save
Save 2-1_Algorithm_19_batch For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
4 views
2-1 Algorithm 19 Batch
question
Uploaded by
soccho66
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save 2-1_Algorithm_19_batch For Later
Carousel Previous
Carousel Next
Save
Save 2-1_Algorithm_19_batch For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
Shabjalal University of Science and Technology Department of Computer Science and Engineering and year Ist Semester Final Examination-2021 Session— 2019-20 Course No.— CSE237 Course Title— Algorithm Design & Analysis Time— 3 Hours Credit: 3.00 Total Marks# 100 (Answer all the questions and keep your answers to the point.) Group A GQ Answer the following Questions (Any Five ) 2* 5-10 a) Ifa problem does not have overlapping sub-problems, what would happen if Dynamic Programming is used to solve the problem? b) For a dynamic programming algorithm, computing all values in a bottom-up fashion is asymptotically faster than using recursion and memoization, Is it true? Justify your answer. ) Can we say the runtime of an algorithm is 0 (2%) when the actual runtime is roughly (i) 2 +¢, (i) 2% +c. 4) What are the four basic properties to be a good hash function? e) Build LCP array for the string "aacaabaac", ) Which data structure is suitable to implement a Priority Queue? What are the complexities of push(x), pop0, and top() operations, 8) Write the names of two sorting algorithms that apply the Divide and Conquer approach. Write their time complexities in Best, Average, and Worst case scenarios. h) Draw a graph with negative edges where Dijkstra will be able to find the shortest path between any pair of nodes. Q2 Answer the following Questions (Any Four ) 5 x 4-20 a) Check if the following statement is True or False, If the statement is False, write the correct statement, 1) Krushkal is better than Prims for finding the Minimum Spanning Tree within a graph in terms of time-complexity. 2) The insertion complexity of an element in a Heap data structure is 0 (NlogN), where N is the number of elements currently on the heap. 3) Bellman-Ford will be able to find the shortest path between 2 nodes of a weighted-connected graph if all the edges are positive weighted, 4) Memory complexity of the Matrix-Chain-Multiplication algorithm is 0 (N*) 5) Sometimes Bottom-up approach of dynamic programming can be more memory- efficient compared to the Top-down approach. ) b) Assume there is only one classroom and you have to schedule the following classes, ‘The duration of each class is 1 hour and your objective is is to maximize the totalnumber of students served, © Classes start from 11:00 am in the morning. © Each of the classes must end before their respective deadline. © Classes can be arranged in any arbitrary order. It is okay to start CSE333. anytime from 11:00 am to 1:00 pm, as long as it ends before 2:00 pm, Class Cade] ‘Students CSEISS 130 CSE233 6 CSE127 100 CSE237 110 CSE333 120 ©) What does Big-0 and Big-@ signifies in an algorithm? Write the pseudocode of an algorithm where the Big-O and Big-® are 2 different functions. 4) Given a polygon represented by the points A(2,2), B(4,2), (4,4) what would be the updated co-ordinates of the points 4,8, if you rotate the polygon 90 degrees counter clockwise with respect to the origin (0,0). ©) Apply Merge-sort algorithm to sort the following array. arr{] = {12, 3, 4, 13, 8, 9, 10, 5} Just show the states as the arrays divide and merge at each step. You don't have to indicate how it is happening. 9 Apply Extended Euclid algorithm on the pair of numbers 50 and 30 to find ged(s0, 30), x, and y such that 50x + 30y = ged(50, 30) Answer the following Questions (Any Two). 102-20 a) Check if the following graph has an Euler path. If there is, use Fleury’s algorithm to find the Euler’s path, Show each steps. ©) Check if the pattern aacaac exists in the text aacaabaacaac using KMP algorithm, Show each steps. ©) Answer the following questions. 1. Write a function to check if the line segment between a pair of points AC«ty1) and B(x2,y2) intersects with the line segment between the pair of points C(x, ys) and D(xs, y4). struct point{ int x, y; point(int _x, int _y) fx =_x, y = _yJ } bool do_segments.intersect(point A, point B, point C, point D) { eeYOUR CODE HERE .. // YOU ARE FREE TO USE ANY PROGRAMMING LANGUAGE .... // EVEN PSUDOCODE IS ACCEPTABLE. 2, Use the Graham Scan approach to find the Convex Hull of the given points. show each steps graphically, You don’t have to do the calculations to check anticlockwise orientation at each step. (10,10), (27, 5), (15, 5), (23, 0), (35, 5), (30, 10), (20, 20) Group B Q4 Answer the following Questions (Any Five ) 2* 5010 a) Give example of an NP-hard problem, (don’t just write the name of the problem. Write the objective briefly and clearly.) b) How can we solve the Maximum Bipartite Matching using the Ford Fulkerson Algorithm? ©) What is the time complexity of checking if a word exists in a dictionary if every word of the dictionary has been inserted in a Trie data structure? 4) Draw a graph where BFS will work faster than DFS to reach a node from a root node. Your example graph should be unweighted, It can be either directed or undirected. ©) Apply Euclid Algorithm to find the GCD of the pair of numbers 35 and 60, £) "Dijkstra qualifies as a greedy algorithm”, why? g) Define Loop Invariant. h) What are the Bridges and Articulation Points in a connected graph? Q5 Answer the following Questions (Any Four ) 5 x 4=20 a) Apply Sieve of Eratosthenes to find all the prime numbers up to 20 b) Calculate the Longest Increasing Sub-sequence of the following array. You can use either Top-down or Bottom-up approaches. Show each steps/table. arr[] = {3, 4, 13, 8, 9} ©) Find a valid topological sorting order for the following graph, a --> b indicates that a must appear BEFORE b in a valid order. 4) Calculate the Hash value of the word aacaabacb with the mapping 1 a2—>b 3 Use the prime 17 as the base and mod the values at each step with 107,©) Use the Krushkel algorithm to find the Minimum Spanning Tree of the following weighted-connected graph, ) Build a Sparse Table for performing Range Minimum Query with the following values. The array is 0-indexed, arr{] = (12, 3, 4, 13, 8, 9, 10, 5} Then, find the minimum value within the range (2 to 7). 6 Answer the following Questions (Any Two). 10x2=20 ) Apply Ford Fulkerson algorithm to find the Maximum Flow permitted by the following network, Source node is 1 and the sink node is 6. 5) Find all the strongly Connected Components in the following directed graph using an algorithm of your preference. Time complexity should not exceed O(N). ©) Consider the shapes following matrices: [2x4], [4xé], [6x40], [40x8] 1, Find the minimum number of scaler multiplication required to find the Matrix Multiplication result, 2. What is the optimum order of that multiplication? Show using brackets. Further explanation is unnecessary,
You might also like
Comp 314 - 2017
PDF
No ratings yet
Comp 314 - 2017
4 pages
Du Daa - QP 2022
PDF
No ratings yet
Du Daa - QP 2022
5 pages
DAA - Questions BANK
PDF
No ratings yet
DAA - Questions BANK
8 pages
Materi Analisis Dan Design Algoritma
PDF
No ratings yet
Materi Analisis Dan Design Algoritma
4 pages
CPCS 223 - Final Exam (85 Points) - 120 Minutes: Name: Number
PDF
No ratings yet
CPCS 223 - Final Exam (85 Points) - 120 Minutes: Name: Number
3 pages
MCS 031 Notes
PDF
No ratings yet
MCS 031 Notes
5 pages
DAA PYQ
PDF
No ratings yet
DAA PYQ
9 pages
Design and Analysis of Algorithms
PDF
No ratings yet
Design and Analysis of Algorithms
4 pages
Design and Analysis of Algorithm - QB
PDF
No ratings yet
Design and Analysis of Algorithm - QB
14 pages
CB402 _ DAA
PDF
No ratings yet
CB402 _ DAA
10 pages
DAA SEM4
PDF
No ratings yet
DAA SEM4
4 pages
Adobe Scan 14-Dec-2024
PDF
No ratings yet
Adobe Scan 14-Dec-2024
15 pages
Btech Cs 5 Sem Design and Analysis of Algorithms Rcs 502 2018 19
PDF
No ratings yet
Btech Cs 5 Sem Design and Analysis of Algorithms Rcs 502 2018 19
2 pages
Exam
PDF
No ratings yet
Exam
9 pages
Col106 Iitd
PDF
No ratings yet
Col106 Iitd
90 pages
DAA Final Examination 2003en
PDF
No ratings yet
DAA Final Examination 2003en
10 pages
CSE - CS402 - DESIGN AND ANALYSIS OF ALGORITHMS - R21 - Booklet
PDF
No ratings yet
CSE - CS402 - DESIGN AND ANALYSIS OF ALGORITHMS - R21 - Booklet
2 pages
DAA 6TH.pyq
PDF
No ratings yet
DAA 6TH.pyq
5 pages
UNIT 2 DAA MOCK paperS
PDF
No ratings yet
UNIT 2 DAA MOCK paperS
10 pages
Solutions To Set 140
PDF
No ratings yet
Solutions To Set 140
18 pages
DAA Previous Paper
PDF
No ratings yet
DAA Previous Paper
14 pages
ADA Question Bank
PDF
No ratings yet
ADA Question Bank
8 pages
DAA PBL
PDF
No ratings yet
DAA PBL
10 pages
Final 2023_PartB_Solution
PDF
No ratings yet
Final 2023_PartB_Solution
13 pages
Question
PDF
No ratings yet
Question
10 pages
2011 Daa End-Regular
PDF
No ratings yet
2011 Daa End-Regular
4 pages
DAA All-Quizzes
PDF
No ratings yet
DAA All-Quizzes
9 pages
DaaS
PDF
No ratings yet
DaaS
5 pages
Final Solutions: and Analysis of Algorithms
PDF
No ratings yet
Final Solutions: and Analysis of Algorithms
21 pages
Time: 3 Hours Total Marks: 70
PDF
No ratings yet
Time: 3 Hours Total Marks: 70
16 pages
Daa
PDF
No ratings yet
Daa
3 pages
Imp Qns for DAA[1]
PDF
No ratings yet
Imp Qns for DAA[1]
6 pages
Quiz 2
PDF
No ratings yet
Quiz 2
8 pages
UNIT-1 2 Mark Questions
PDF
No ratings yet
UNIT-1 2 Mark Questions
11 pages
Exam Examples
PDF
No ratings yet
Exam Examples
15 pages
ف1
PDF
No ratings yet
ف1
4 pages
BT0080 - Fundamentals of Algorithms-MQP
PDF
No ratings yet
BT0080 - Fundamentals of Algorithms-MQP
19 pages
Question Bank AP
PDF
No ratings yet
Question Bank AP
4 pages
CS3CO13-IT3CO06 Design and Analysis of Algorithms
PDF
No ratings yet
CS3CO13-IT3CO06 Design and Analysis of Algorithms
4 pages
Daa Question Bank
PDF
No ratings yet
Daa Question Bank
5 pages
Daa Question Papers
PDF
No ratings yet
Daa Question Papers
9 pages
CS70 Midterm Exam 1 Summer 2010
PDF
No ratings yet
CS70 Midterm Exam 1 Summer 2010
9 pages
FIT2004 Past Year Paper
PDF
No ratings yet
FIT2004 Past Year Paper
19 pages
Questions
PDF
No ratings yet
Questions
31 pages
2015-Spr
PDF
No ratings yet
2015-Spr
4 pages
AA TestSample Solutions
PDF
No ratings yet
AA TestSample Solutions
10 pages
Final Spring18
PDF
No ratings yet
Final Spring18
3 pages
DAA QUESTIONS
PDF
No ratings yet
DAA QUESTIONS
2 pages
Algorithm Design Analysis
PDF
No ratings yet
Algorithm Design Analysis
11 pages
DAA 2019-2020 PYQ
PDF
No ratings yet
DAA 2019-2020 PYQ
4 pages
AD3351 - DAA SET B-Answer Key
PDF
No ratings yet
AD3351 - DAA SET B-Answer Key
5 pages
Ec2m Dseclzg519 Key
PDF
No ratings yet
Ec2m Dseclzg519 Key
6 pages
Data Structures Question Paper
PDF
No ratings yet
Data Structures Question Paper
10 pages
QP2
PDF
No ratings yet
QP2
44 pages
AA Exam 2021 Answers
PDF
No ratings yet
AA Exam 2021 Answers
6 pages
ALL PYQ
PDF
No ratings yet
ALL PYQ
4 pages
M269-Final-By ISA-5th Edition
PDF
No ratings yet
M269-Final-By ISA-5th Edition
110 pages
AD I Practice Questions
PDF
No ratings yet
AD I Practice Questions
11 pages
Design and Analysis of Algorithms Lab
PDF
No ratings yet
Design and Analysis of Algorithms Lab
62 pages