0% found this document useful (0 votes)
7 views

DAA

The document is an examination question paper for a B.Tech course in Computer Science and Engineering, focusing on Design and Analysis of Algorithms. It includes various questions related to algorithm design, time complexity, and specific algorithms like Quicksort and Prim's algorithm. Students are instructed to answer a selection of questions within a specified time limit and are allowed to use non-programmable calculators and data handbooks.
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
0% found this document useful (0 votes)
7 views

DAA

The document is an examination question paper for a B.Tech course in Computer Science and Engineering, focusing on Design and Analysis of Algorithms. It includes various questions related to algorithm design, time complexity, and specific algorithms like Quicksort and Prim's algorithm. Students are instructed to answer a selection of questions within a specified time limit and are allowed to use non-programmable calculators and data handbooks.
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
You are on page 1/ 16
jiog. No, of Student J wat ai Examination Question Paper 19 Engineering and ination June 2022 | Semester End Exari Zomputer Science an B.Tech. in Computer Department: >| Seetaariig science and Engineering | aE ST patch 2020 Course Title INSTRUCTIONS TO STUDENTS: Answer any five full questions Use of non-programmable scientif Use of data handbook permitted wh fic calculator is permitted rerever applicable Missing data may be appropriately assumed Notations used have usual meaning Yeune in rks: 101 IMPORTANT: You may retain the question paper for future reference To [se] | a. | > Question Marks | €O | No. | No. | Solve the following using Master's Theorem: | i. Tn) = 4T(n/2) + nlog’n | 6T(n/2) +07 2*s=10| 3 a T(n/2) + n/logn . 1 T(n-1) +1. v. T(n)=4T(n/2) + (nlogn)? pp_| Solve the recurrence relation M(n) = 2M(n— 1) + Lusing wo | 3 Backward Substitution Method. @ | Briefly discuss the concept of minimum spanning tree with an example.| 05 | 2 | Derive the time complexity of Prim’s and Kruskal’ algorithm. os | 3 [-—T Apply Prim’s algorithm to find the minimum spanning tree from the below graph. Consider Node ‘0’ as the source node. 2 c 10 [pl 20CsC214A page tof2 @ UNIVERSITY —— Write the algorithm of quick sort and Illustrate its worst case time | complexity. 08 Apply Quicksort to the below list of items stored in an array in the order shown below. Consider the element in the Oth index as pivot. Determine the position of all the elements in the array after the first iteration. 2]3 }4]s]e]7 ]e jo | 10] 11) 12) 13] 14 Index | 0 tem | 14 10 | 24] 46 | 12 | 40 | 27 | 47 | 37 | 32) 6 | 44 | 10| 12 | 10 Loja 12 Briefly discuss the concept of dynamic programming with an example. 05 Given: 4 matrices (A1, A2, A3, A4) of dimensions A1: 40x20, A2: 20x30, ‘A3: 30x10 and A4: 10x30, determine the most efficient way to multiply the matrices. 15 Illustrate in detail the difference between NP-Hard and NP-Complete problems. 10 Discuss Travelling Salesman Problem using approximation algorithm. 10 Define Amortized Analysis with pictorial representation. Write the formula for aggregate analysis and determine the cost of n insertions and average cost of each insertion in a dynamic table. 10 Discuss randomised algorithm with an example. 10 *CO — Course Outcomes Course Outcomes Describe the concepts of design of algorithms. Explain the principles of analysis of algorithms Choose appropriate techniques for design and algorithms for a given problem ‘Analyse the worst case and average case complexity of a given algorithms Define efficient algorithms for a given problem 1 2 3 4 5 6 Compare algorithms based on appropriately chosen measures of complexity. wor? ost AMAIAH ZG ONIVERSITY nolo; Faculty of Engineering and ae is reek Midterm Examination Question Pap Department : Computer Science and Engineering Programme :19CSC214A Semester / Batch 14/2022 Date of Test 9/05/2022 Course Code :LOMICSO1A — \SD bins Course Title : Design and Analysis of Algorithm: Midterm Examination INSTRUCTIONS TO STUDENTS Maximum Duration: 2 Hours i le 5 1. Q.No. 1. and2 is compulsory and answer any two SE eee 2. Missing data may be appropriately assumed and notations usec - Maximum Marks: 50 Question Marks AA The measure of the longest amount of time possibly taken to complete an algorithm is expressed as _. a. Little-O b, Little-Omega c. Big-Omega d. Big-O 1.2 —— ofan algorithm is the amount of time required for it to execute, a. Time complexity b. Space complexity ¢. Compiling time d. Best case 1.3, ‘Which of the following is incorrect? Algorithms can be teptesented: a. As programs b._As flowcharts 19MICSO1A Page 1 of 4 ntax 4. As prendocodes 1.4 | What should be considered when designing an algorithm? & If the software is used correctly b. If the hardware is used correctly ©. If there is more than one way to solve the problem d. All of the above are correct The worst-case time complexity of Quicksort is? 15 }a. O(a) b. O(n%2) « O(1) 4. O(log n) Q2. z ; : 5 Define Algorithm. Explain the features of an efficient algorithm ‘Apply master theorem to derive the time complexity for the below functions: : n : i - T(m) = 16T () + (logn) + = n nt i, T@)=0rG)+ 5, Q3. | 3.4 ii, T(n) = 2"7("/p) +n" 10 w. TO) =37(2)+vn vy. Tn) =TECN/3) +1 3.2 Se he eT pe ee Compute the time complexity of the following codes method and express in terms of Big O notation. _ [int a =0,b = 0; i. | for i= 0;i< Nyit+) a=a+ rand); } for (j = 0;j < Ms j++) { b =b + randQ; } i unt. using frequency Cot reir a aaa inta=0; for @ = 0;i < N3i++) for G = Nij >} { } azatitj it } inti, k= 05 for @= 0/25 i <= n;it+) for (= 2 j<=mj=i"2) : k=kt0/2 while i ? > their growth, from slowest growing, | Exphin Rio Tea notations © hain Bi cotations with, ig O, Big Omega and Big Theta notat Fepresentation ‘Rank the following fanetions according t to fastest growing, st clit nlogen logan [ nlogen logan | gen 64 an ] terms of their ©. Only 5.2 | Match each function with an equivalent function, in match a function if f2)=©(4()) 7 n+30 n? + 2n—10 n n? x 3n n+ 3n 5.3 | For the functions, 8 and 4" what is the asymptotic relationship between ; a these functions? Justify 5.4 | For the functions, n* and c”, what is the asymptotic relationship between : x these functions? Justify Assume that k 2 land c > 1 are constants. CO: Course Outcome CO-1: Describe the concepts of design of algorithms CO-2. Explain the principles of analysis of algorithms CO-3. Choose appropriate techniques for design and analysis of algorithms for a given problem CO-4, Analyze the worst case and average case complexity of a given algorithm CO-5. Design efficient algorithms for a given problem CO-6, Compare algorithms based on appropriately chosen measures of complexity x pave? o Bo ee see Course Leader 19MICSO1A Page dof Fa i ic ay of Engineering & Technology ee ‘amaiah University of Applied Sciences r End Examination Question Paper —B. Tech. Depart ment: ‘ent: Computer Science & Engineering Prograi mme/Branch: ia Ich: B.Tech in Computer Science and Et ter/Year: 4'" Semester / 2” Year Batch: 2014 Examination Date: 27 MAY 2016 Course Code: CSC209A Co itle: urse Title: Design and Analysis of Algorithms Semester E Examination INSTRUCTIONS TO STUDENTS: Answer any FIVE full questions 1. 2. Use only SI units 3. Use of non-programmable scientific caleslator is permitted itted wherever applicable Use of data handbook permit 4. Missing data may be appropriately assumed Maximum Marks: 100 es ‘Maximum Duration: 3 Hours a) List the motivation factors of randomised algorithms, 7 on las Ve d algorithms. Givi b) [Explain the difference between Las Vegas and Monte Carlo randomized alg | 7 examples for each, iz - {343} ) [State and explain the three techniques to compute the probe sequences of open Bec addressing in hashing. +242) a) [Discuss the issues of hashing and methods to resolve them. is 7 z a2 a)_| Explain greedy set cover algorithm. 4 b) | Explain approximate vertex cover. Find the vertex cover with minimum size (it has least 6 number of vertices) for the following graph. [2+4] 7 6 4 3 ©) | Explain objectives of heuristics. Mention the criteria to solve heuristic problem. 5 [144] 4d) |What is subset sum approximation problem? Which are the important terminologies 5 used in approximation algorithms? (1+4] a3 a) |Soive the following: 12 1) fin) = 100n +5 (Express f(n) using Big-Oh(0)) [arava] | 2) fin) = 6x2" + n? (Express f(n) using Big- Omega (Q)) 3)_fln) = 10 n*+ 5 (Express fin) using Big- Theta (®)) b)_ | Solve the following recurrence equation using recursion tree method, 8 Tin) =3 T(n/3)+Cn aa a) Find the best case and worst case time efficiency of the algorithm given below. 6 Algorithm unique_elements(a{],n) 343} var a,n : Integer; G3] begin return 0; FG" OF 11 Distinct elements are not present end for end for return 1; //Distinct elements are present b) [Consider a 0/1 knapsack dynamic pro _——— programming technique. Aj i instance of the knapsack problem with capacity ny-=¢ = ique. Apply to the following 8 Page 2013 a) b) L_| HK _| otherwi Le | TWise COver of sin, e {| elements". k, then after __ [Value $12 $10 | $20. $15 Cong Ider Show 4? St Ww "8Ssene 2 th MUltipige, S*@sseqn © Matriy So "Plicatign, °M's Mate nltiblication and its recurrence relation is given below. : “iplication is more efficient than conventional matrix Tn) J 4 (Ya) if net [2+4] Sider a gl reedy 5 set # Set Cover problem, prove the claim given below. 'k iterations the algorithm covers at least 4 of the Consider a dynami ic programin, Matrix chain multiplication, '8 approach. Find the optimal solution for the following Matrices | 1 2 3 Dimension | (2x3) [ (3x6) | (xa) | (x5) c) A sequence of stack operation is performed on a stack whose size never exceed K. After every K operations, a copy of the entire stack is made for backup purpose. Show that the Cost of n stack operations, including copying of the stack is O| (n) by assigning suitable amortised cost to the various stack operation. Q6 a) Consider the minimum spanning tree. Prove the following statement, edge e = (v, w) does not belong to 9 minimum spanning tte of graph G ifand only if v hae an be joined by a path consisting entirely of edges that are cheaper than e”. and w b) how that Hamiltonian cycle is NP-complete. : NP-completeness. SI Consider the ¢) . i false and justify. ey i wing statement is true or Verify if the follo ndomized algorithm A has expected running time O(n ai “suppose that a § possible for some execution of A to take 0(3") time”, ?) on any input of size n. Then itis ee RAMAIAH UNIVERSITY OF APPLIED SCIENCES Faculty of Engineering & Technology Semester End Examination Question Paper ~ B. Tech. Department: Computer Science and Engineering Programme: B. Tech. Semester/Batch: 4 / 2016 Date of Examination: 9" June 2018 Course Code: CSC209A Course Title: Design and Analysis of Algorithms Epos ed tat: eo teint Theory INSTRUCTIONS TO STUDENTS: Answer any FIVE full questions Use only S! units Use of non-programmable scientific calculator is permitted Use of data handbook permitted wherever applicable Missing data may be appropriately assumed Indicate the question number (including its part as applicable) for your answers oy ayn Maximum Marks, 1m 7 urs Maximum Duration: 3 Hol IMPORTANT: he end of the examination. Please keep it in a safe the it You may take this question paper away a! ference place for future refer’ coi on 1, Perform matrix chain multiplication optimal parenthesis substructure. matrices given in Table + Ag and explain the Table 1 a. Consider the size of the for Ay* Az * As" 4s As 12 5 ] b. Solve the following instance of the 0/1 Knapsack problem using branch and bound method and explain the time complexity. Number of elements = 4, Capacity = 8, Weights = {2,3,4,5}, Profit = {1,2,5, 6} c. Explain Floyd-Warshall’s algorithm for determining the shortest path between all pairs of a given graph with a suitable example. Question 2 (5 +10 +5 =20 Marks) a. State the similarities and differences between divide-and-conquer and dynamic programming approaches. b. Explain the pseudocode and const i ; ruct an optimal bin wen frequencies as given in Table 2. a et Table 2 Key Number T z Key Value soe pet Frequency ee c. conewrict a Huffman code tree for the data given in Table 3 and perform encoding and lecoding of the text “DEFACEDG” using a lossless compressed codes. So piles ee Character | A__| B (Cc DIE F G Frequency 18 | 2 30 | 17 | 6 Question 3 (5 +10 +5=20 Marks) a. Consider the two sequences X= (xy Xx, “1 Xn) and = ar Yar nds Analyze and determine the optimal structure of the longest common subsequence using dynamic programming, b. Determine the minimum spanning tree for the graph given in Figure 1 using Prim’s algorithm with source node as ‘a’. Analyze the time complexity and the space complexity. Figure 1 rom source node A to all the other nodes in the c. Determine the costs of shortest paths fi ‘an Ford algorithm. Analyze the time complexity graph given in Figure 2 using the Bellm: and the space complexity. Question 4 (10+ 10 = 20 Marks) a. Perform the analysis of each step in insertion sort to analyze the best case, average case and worst case time complexity using asymptotic notations. b. Compare the naive algorithm and the divide and conquer-based algorit the maximum and minimum numbers in a given array A [] of size m. Id of comparisons and time complexity in each algorithm. ‘ ithm to determine entify the number (10+ 5 +5 = 20 Marks) i ; ive Grade Poi Question 5 rding to Cumulative int dents acco j d: tb i ing records of stu their records must be stable cone malt rn tt en ts Average . insider : Rete 0 that nears they are ordered alphabetically. rn these sorting algorithms and justify the Merge sort. d Insertion sort, Selection sort an Sort! ; most suitable algorithm to perform a stable SOT ¢ function: b. Determine the time and space complexity of a. void function(int n) count++; } c. Formulate the time complexity of following C function: void function2( int n ) { if (n==1) return; for(i=1;icen;i++) { - for( j=1;j<=n;j++) { print(“*"); break; } } } ouestion ¢ (10+ 10 = 20 Marks) a. Solve the following recurrence relation using backward substitution method and determine the complexity. T(n) = 2T(n-1)—11fn > 1. Otherwise, T(n)=1 b. Consider a Sudoku puzzle with a partially filled 9. x 9 array of integers, The goal is to assign digits from 1 to 9 to the empty cells so that. every row, column and sub grid of size 3 x 3 contains exactly one instance of digits. i) Develop an algorithm using backtracking approach to solve the puzzle. ii) Formulate the asymptotic notations for time and space complexity. Ss RAMAIAH UNIVERSITY OF APPLIED SCIENCES Faculty of Engineering and Technology Semester End Examination Question Paper — B.Tech. Department: Computer Science and Engineering Programme: B.Tech. in Computer Science and Engineering Semester / Batch: 4"/ 2017 Date of Examination : 25-05-2019 Course Code: csc209A Course Title: Design and Analysis of Algorithms Theor Semester End Examinat INSTRUCTIONS TO STUDENTS: Answer any FIVE full questions Use only SI units Use of non-programmabie Use of data handbook permitted wherever applicable Missing data may be appropriately assumed ntific calculator is permitted PRUNE Maximum Duration: 3 Hours Maximum Marks: 100 IMPORTANT: You may take this question paper away at the end of the examination. Please keep it in a safe place (446410529 ith suitable examples. ty ‘ven in Table 1 and perform encodin Question 1 of dynamic programming wi ff bits required for encoding ‘a. List the feature: ve tree for the dota 6 b. Construct a Huffman co the total number text mississippi’. determine Tabled ean! Bory, i ing algorithms: ive ti Joxity for the follow! c. Derive time comp! : * senna i. Algorithnd Aor {int ijk; Dar for(ien/2jic=niit+) =njj=j+i) printf(“CSE”); printf(‘msruas”); in Question 2 (4+6+10=20 Maris) 2. Design a recursive binary search algorithm and analyse its time complexity. b. Perform the analysis of each step in Merge sort algorithm to derive the best case, average case and worst case time complexity using asymptotic notations. ‘ c. Consider a scenario of a local area network represented by a graph, where computer systems represent vertices and edges represent a connection. Design an algorithm to compute the shortest cable length required between any two computers. Question 3 a i i (4+6+10=20 Marks) a. Define Transitive Closure of a graph with a suitable example. b. Solve the following recurrence relation and determine the time complexity. Tn) SI 27(n/2) + 4n forn > Land T(1) =4 : algorithm. Question 4 has a. Explain NP- Hard and NP-Complete classes of problems with a suitable exami” ple, b. Consider the set of elements w = {10,7,5, 18, 12,20, 15} and m = 35, Det, the subsets of w each of which results in the sum m using a state space cama all c. Consider two strings A="pqqrr" and B="pqprarp". Let x be the length of the lon common sub-sequence (LCS) between A and B and let y be the number of such tes between Aand B, Determine the LCS using dynamic programming and compute the value of 2x + 4y. Question 5 i (4+6+10 = 20 Marks) a. Explain divide and conquer technique used in Quick sort, b. Consider a graph given in Figure 2 with the nodes representing the cities and the edges connecting the cities with the specified cost along each edge. Determine the costs of shortest paths between all pairs of cities in the graph using the Floyd-Warshall algorithm. Analyze the time complexity. é Figure 2 c. Consider the size of the matrices given in Table 2. Perform matrix chain multiplication for A+ Az + Az*Ag and explain the optimal parenthesis substructure. Table 2 Matrix No. of | No. of Rows _| columns A, 2 2 Ap 2 4 Ay 4 2 Ay 2 6 Question 6 (4+6+10= 20 Marks) a. Derive the time complexity of Tower of Hanoi problem using recurrence relations. +b. Solve the following instance-of the 0/1 Knapsack problem using dynamic programming method and explain the analysis of algorithm. Number of elements = 4, Capacity = 5, Weights = {2,3, 4,5}, Profit = {3,4,5,6} Ane c. Design an algorithm to construct the optimal binary search tree (BST). Determine | and structure for the keys, i = 1,2,3,4 with probabilities P; as given in Table Table 3 Key|10 [20 | 30 | 40 Bil4 (2 [6 |3 oh

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy