Daa Course File Final 2012

March 24, 2018 | Author: gurusodhii | Category: Computational Complexity Theory, Time Complexity, Dynamic Programming, Algorithms


Comments



Description

SHAHEED UDHAM SINGH COLLEGE OF ENGG.& TECHNOLOGY, TANGORI (MOHALI) Department of Computer Science and Engineering COURSE FILE DESIGN & ANALYSIS OF ALGORITHMS CS - 307 5TH SEM C.S.E Teacher: Er. Gurjot Singh Sodhi July - November 2012 Course File - Design & Analysis of Algorithms RATIONALE : Informally, an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the input into the output. We can also view an algorithm as a tool for solving a well-specified computa-tional problem. The statement of the problem specifies in general terms the desired input/output relationship. The algorithm describes a specific computational proce- dure for achieving that input/output relationship. For example, one might need to sort a sequence of numbers into non decreasing order. This problem arises frequently in practice and provides fertile ground for introducing many standard design techniques and analysis tools. Here is how we formally define the sorting problem: Input: A sequence of n numbers 〈a1 , a2 , . . . , an 〉. Output: A permutation (reordering) 〈a1 , a2 , . . . , an 〉 of the input sequence such that a1 ≤ a2 ≤ · · · ≤ an . For example, given the input sequence 〈31, 41, 59, 26, 41, 58〉, a sorting algorithm returns as output the sequence 〈26, 31, 41, 41, 58, 59〉. Such an input sequence is called an instance of the sorting problem. In general, an instance of a problem consists of the input (satisfying whatever constraints are imposed in the problem statement) needed to compute a solution to the problem. Sorting is a fundamental operation in computer science (many programs use it as an intermediate step), and as a result a large number of good sorting algorithms Which algorithm is best for a given application depends on—among other factors—the number of items to be sorted, the extent to which the items are already somewhat sorted, possible restrictions on the item values, and the kind of storage device to be used: main memory, disks, or tapes. An algorithm is said to be correct if, for every input instance, it halts with the correct output. We say that a correct algorithm solves the given computational problem. An incorrect algorithm might not halt at all on some input instances, or it might halt with an answer other than the desired one. Contrary to what one might expect, incorrect algorithms can sometimes be useful, if their error rate can be controlled. An algorithm can be specified in English, as a computer program, or even as a hardware design. The only requirement is that the specification must provide a precise description of the computational procedure to be followed. 2|Page Course File - Design & Analysis of Algorithms What kinds of problems are solved by algorithms? Sorting is by no means the only computational problem for which algorithms have been developed. (You probably suspected as much when you saw the size of this book.) Practical applications of algorithms are ubiquitous and include the follow-ing examples: •The Human Genome Project has the goals of identifying all the 100,000 genes in human DNA, determining the sequences of the 3 billion chemical base pairs that make up human DNA, storing this information in databases, and devel-oping tools for data analysis. Each of these steps requires sophisticated algo-rithms. The savings are in time, both human and machine, and in money, as more information can be extracted from laboratory techniques. •The Internet enables people all around the world to quickly access and retrieve large amounts of information. In order to do so, clever algorithms are employed to manage and manipulate this large volume of data. Examples of problems which must be solved include finding good routes on which the data will travel (techniques for solving such problems ), and using a search engine to quickly find pages on which particular information resides 1.1 Algorithms •Electronic commerce enables goods and services to be negotiated and ex-changed electronically. The ability to keep information such as credit card num-bers, passwords, and bank statements private is essential if electronic commerce is to be used widely. Public-key cryptography and digital signatures are among the core technologies used and are based on numerical algorithms and number theory. •In manufacturing and other commercial settings, it is often important to allo-cate scarce resources in the most beneficial way. An oil company may wish to know where to place its wells in order to maximize its expected profit. A candidate for the presidency of the United States may want to determine where to spend money buying campaign advertising in order to maximize the chances of winning an election. An airline may wish to assign crews to flights in the least expensive way possible, making sure that each flight is covered and that government regulations regarding crew scheduling are met. An Internet service provider may wish to determine where to place additional resources in order to serve its customers more effectively. 3|Page Design & Analysis of Algorithms SYLLABUS 4|Page .Course File . Knuth. 1968. Vols. [L12] Problem classes P. 2. Springer Verlag. K.1975.V.Mehlhorn. 1984. 3. Branch and bound. [L-8] Algorithm design techniques: divide and conquer. S. time and space complexities and average and worst case analysis.Hopcroft. Addison Wesley. OBJECTIVES: Date Structures are an integral part of algorithm design and Discrete Structures covers topics like graph theory.. J. 1984. J. 1985.D. combinatorial algorithms. design and Analysis of Algorithms. [L-6] TEXT BOOKS 1. Vols. Purdom. D. string processing algorithms. Approximation algorithms for some NP-complete problems. Dynamic programming.307 DESIGN AND ANALYSIS OF ALGORITHMS External Marks: 60 L T P Internal Marks: 40 3 1 Total Marks: 100 PREREQUISITES: Discrete Structures and Data Structures. Galgotia Publishers. 1 and 3. REFERENCES: 1. Addison Wesley. Aho. NP-hard and NP-complete. lower bounds. set algorithms. Data Structures and Algorithms. order arithmetic. Sahni. 5|Page . 2. The Analyses of Algorithms. COURSE CONTENTS: Models of computation. Algebraic algorithms. search and traversals. NP. [L-16] Sorting and searching algorithms. Hard problems and approximation algorithms. Jr. 1976. Ullman. deterministic and non deterministic polynomial time algorithms. Algorithm analysis. Backtracking. Holt Rinechart and Winston.and C. Brown.Design & Analysis of Algorithms CS .Course File .E. 1 and 2.Horowitz.E. The Art of Computer Programming. Fundamentals of Computer Algorithms. A. Course File .NO TOPICS PAGE NO. 1 2 3 4 5 6 7 Time Table Assignments Sessionals Question Bank University Papers Viva Voice Questions Tutorial Sheet 7 9 11 16 23 28 34 6|Page .Design & Analysis of Algorithms INDEX S. Design & Analysis of Algorithms TIME TABLE Period/Days Monday Tuesday Wednesday Thursday Friday LAB T 1 L L 2 3 4 LAB LAB LAB L L T 5 6 7 8 9 Period/Days Monday Tuesday Wednesday Thursday Friday 1 2 T 3 4 5 6 7 LAB 8 9 L L L L T LAB LAB LAB 7|Page .Course File . Course File .Design & Analysis of Algorithms ASSIGNMENTS 8|Page . ASSIGNMENT – 3 Q1) Explain P. Q2) Discuss Approximation Algorithms. ASSIGNMENT – 2 Q1) Solve 2nd Sessional Paper . 9|Page .Course File .Design & Analysis of Algorithms ASSIGNMENT – 1 Q1 ) Explain all the Searching techniques. NP Classes. Q2 ) Explain all the Sorting techniques. Course File .Design & Analysis of Algorithms SESSIONALS 10 | P a g e . } Q 4 ) What do you mean by the term Lower bound & Upper bound.j]:= a[i. Is 2n+1=O(2n) ? Give reasons. Q 3 ) Solve the following expression – 5*6+(5+(3/5+4)-1)*3/(5+2) SECTION C 1*10 = 10 marks Q 1 ) Write an algorithm for the following & calculate their Time Complexitya. 11 | P a g e .j]. Q 2 ) Explain an algorithm to insert 5 elements in a Stack and in a Queue. SECTION B 2 * 5 = 10 marks Q 1 ) Explain the use of asymptotic notations in the analysis of algorithms.Design & Analysis of Algorithms Shaheed Udham Singh College of Engg & Technology.Tangori SESSIONAL TEST : 1 Subject : DAA Semester : 5th (A+B) Max Marks : 30 Max Time :11/2hrs SECTION A Q 1 ) a.Course File . Binary Search Q 2 ) Explain various Models of Computation.j]+ b[i. Q 5 ) What do you mean by Growth of Functions. Quick Sort b. The order of complexity of Binary Search in Best case is --------in the average case is -------in the worst case is ----------Q 2 ) How the time and space complexities measured for an algorithm? Q 3 ) What is the computing time for the following statement { for i=1to m do for i=1 to n do c[i. 5 * 2 = 10 marks b. Write a note on String Matching Algorithm? Q2. Differentiate between BFS& DFS? Q5.4.Design & Analysis of Algorithms Shaheed Udham Singh College of Engg & Technology. Q2.c.6> .2. X=9 SECTION-C Q1. Starting from vertex V4. Q3. Explain Knacksap Problem using Branch and Bound. Given S<a. (b) Differentiate between Iteration and Recursion.d.e. SECTION-B 5*2=10 2*5=10 Q1. Q4. Build binary tree according to Greedy Strategy.3. Define a) Cyclic interchange b) Minimum Spanning Tree Q2.f> .5. performa) BFS or DFS b) All spanning tree 1*10=10 12 | P a g e .(a) Define lower bound & Upper bound.8>. Explain Floyd-Warshall Algorithm with an example.Tangori SESSIONAL TEST : 2 Subject : DAA Semester : 5th ( A & B ) Max Marks : 30 Max Time : 11/2 hrs SECTION-A Q1. Differentiate between Krushkal Algorithm & Prim’s Algorithm? Q4.5. Explain the Subset-Sum problem using the followingS=<3.b.Course File . Probability(P)=<1.1. What do you mean by Order Arithmetic? Q3. Design & Analysis of Algorithms Q3 From the given graph. draw a) Minimum Spanning Tree by Krushkal Algorithm b) Minimum Spanning Tree by Prim’s A8lgorithm c) Shortest Path from V1 to V 13 | P a g e .Course File . Q 5 ) Write an algorithm for Knapsack problem using greedy method. Q 2 ) Given an example of an algorithm which is infinite in nature Q 3 ) What are Stored RAM model? 5 * 2 = 10 marks Q 4 ) What is time complexity. (b) Merge Sort Q 3 ) Explain the relationship between Turing Machine and RAM models. Support your arguments with an example and analysis. SECTION C Q 1 ) Write short note on following: (a) Techniques for algebraic problems. (b) Polynomial time algorithm. SECTION B 2 * 5 = 10 marks Q 1 ) Differentiate between N-P Hard and N-P Complete problems with example. Q 3 ) Among Merge sort. Q 4 ) Design an algorithm which finds number of words. 1*10 = 10 marks Q 2 ) What are approximation algorithms? Differentiate between deterministic and nondeterministic algorithms . 14 | P a g e .Design & Analysis of Algorithms Shaheed Udham Singh College of Engg & Technology. What is the time complexity of Merge Sort? Q 5 )Name three conditions under which sequential search of a list is preferable to binary search. Insertion sort and Bubble sort which sorting technique is the best in worst case. Q 2 ) Write a algorithm for (a) Quick sort.Tangori SESSIONAL TEST : 3 Subject : DAA Semester : 5th ( A & B ) Max Marks : 30 Max Time : 11/2 hrs SECTION A Q 1 ) (a) What is stable sorting? (b) Define Cooks – Levin Theorm. lines and characters in a given text.Course File . Design & Analysis of Algorithms QUESTION BANK 15 | P a g e .Course File . 20.j<n. 16. 17. 27. 23. How does heap Sort work? Explain the backtracking Problem with 4 Queens on a 4*4 chess board. 29. 16. 18. 24. 18. Differentiate between Binary and Binary Search Tree. What are the advantages of dynamic programming over greedy method? What are the various techniques for design of various algorithms? How the time and space complexities measured for an algorithm? What is the order of Bubble Sort? What are the conditions under which backtracking can be used? What is Optimal Merge Pattern Problem? What is algorithm for in order traversal? What is solution space in Backtracking Techniques ? How will Merge Sort sort the 6 numbers: 40. Define the term Divide and Conquer. 3.i<n.Course File . 39.62. 6. 19. 36. What is time complexity ? What is space complexity? Give brief concept of Divide and conquer. 37. 32. 14. What is lower bound? What are explicit and implicit constraints? What is algebraic simplification? 16 | P a g e . What are the various set operations possible? What is algorithm of Pre Order Traversal. Define non deterministic algorithm. What is recursion?What are its drawbacks? The order of complexity of Binary Search in Best case is -----in the average case is ------in the worst case is -------If W= MNOP.j+1) 33. 15. 4. 10. 21. Write an algorithm for insertion sort. 40. That is root is visited first then the intermediate children of root then grand children of root and so on. by divide and conquer technique. 11. 42. 41. for(i=1. 9. What is Binary Search Tree? 31. Write an algorithm that will traverse a binary tree level by level.i+1) for(j=1.list all substrings of W. 28. 35. 2. 8. 30. 7. 12. Write an algorithm to sort an array containing 0's and 1's with complexity of order of n . 34. 22. What are various steps used in design of an algorithms?Give an example of algorithm which is infinite in nature. 38. 13. 20 . Also give its computing time. What is the order of the computation for the following loop. Give the definition for 0/1 knapsack problem. 5.Design & Analysis of Algorithms QUESTION BANK 1. 10. 26. What is NP Hard Problem? What is Ordering Paradigm? Differentiate between full and complete Binary Tree. Is 2n+1=O(2n)? What is the worst case running time of Quick Sort? What is the worst case running time of algorithm to delete each element from the linked list? Which is more efficient of BFS and DFS? What are maximum and minimum number of elements in a heap of height h? Where in a heap might the smallest element reside? Differentiate between NP Hard and NP Complete . 25. 45. What type of operations can be performed on string's . Describe an algorithm to insert and delete edges in the adjacency list representation for an undirected graph . What do you mean by Time and space complexity. Differentiate between Deterministic and Non Deterministic algorithms. What are the disadvantages of Binary Search algorithm . 60. What is LC Search. 52.Explain with the help of suitable algorithms. Give an algorithm to count number of leaf nodes in a Binary Tree t and what is its computing time 51. Which algorithm is best to sort the data and why? 56.Write an algorithm to find out minimum number of edges to be added to G so that G becomes disconnected .Explain at least 2 operations on strings with algorithms. What are the various methods or techniques in which various algorithms can be expressed? 63.Heap Sort.Sort them using a Quick Sort . 54. 46.Course File .Your algorithm should output such a set of edges . Write an string processing algorithm to identify whether a particular sequence of character is in string or not.Insertion Sort Heap Sort. 58. 61.What will be the order of complexity of a Binary Search in the unsuccessful case 57.Remember that the edge (i.Design & Analysis of Algorithms 43. What is Criterion Function ? Define the Principal of Optimality. What is criterion function in backtracking?What is solution space for backtracking problem? Explain by taking sum of subset as a problem 64.What are time and space requirements of your algorithm 59. Here are 16 integers: 22 36 6 79 26 45 75 13 31 62 27 76 33 16 62 47 . 47. 44. What is time and space complexity of “Insertion Sort”?Explain. What are Decision Problems? What is Interpolation of polynomial? Short Answer Type Questions 49. 62. Among Quick Sort. Let G be a connected and undirected graph .Insertion Sort . How will u represent a polynomial using dense representation strategy.Bin Sort. 17 | P a g e . Explain the use of asymptotic notations in the analysis of algorithms 53. How does it help in finding a solution for Branch and Bound Algorithm.find out the shortest distance of all the nodes from the node A .treating them as a pair of digits in a range of 0-9. In the following Graph . Explain basic concepts of NP hard and NP Complete problems. 48.j) appears on the adjacency list for both vertex i and j 50. Write short notes on the following: (A)Dynamic Programming ( B) Branch and Bound 55. 76.30. 75. Explain algorithm for evaluating a polynomial in coefficient exponent form. 77.” 72. Algorithm sum(a. Also represent the merge pattern using Binary Tree. Explain why we use a asymptotic notation . Explain an algorithm to insert 5 elements in stack and in a Queue. return s .Also mention the worst case running time for this operation. 68. What is 8 Queens problem?How does backtracking helps in solving it. 80. What will be time and space complexity for the algorithms. 88. Write an algorithm to delete an element from a linked list . 82. Justify the statement “An optimization problem can be solved in the polynomial time if and only if the corresponding decision problem can. Using the recursive algorithm . 86. Explain how to validate and analyze the algorithm . What is evaluation and interpolation of Polynomials. 67. } 84. Define Algorithm and also explain the different criterion that all algorithms must satisfy. Using suitable example explain straightforward evaluation of polynomials 78.Design & Analysis of Algorithms 65.X5 )of length 20.. } 74. Explain the various path traversal techniques with example. Explain Traveling Salesperson Problem 90. Explain by giving a suitable example 71.30 respectively. 66. for i=1 to n do s=s+a[i].5.. 70.Explain All pairs Shortest Path problem 18 | P a g e .X2. 83.0. Merge the files (X1. What is Optimal Merge Pattern problem.explain how the tower of Hanoi problem can be solved. Explain the connected and Biconnected components in Graphs. What is the computing time for the following statement {for i=1to m do for i=1 to n do c[i.Discuss various techniques for algebraic problems. 81.n) { s=0. Explain 0/1 knapsack problem using Dynamic Programming. Explain what do you mean by algebraic problem . What do you mean by dynamic programming . Give brief concept of Algebraic Simplification and algebraic transformation 79. What is Greedy Method ?Write an algorithm for knapsack problem using Greedy Method.j]:= a[i.10. Define Prim's and Kruskal Algorithms 89.j]+ b[i. 69. Explain the different terminologies for tree and graph 87.Course File .. Explain the Big Oh notation used in the analysis of algorithm 73. Define Principal of Optimality. Explain the tree traversal techniques.j].Also define the following notations (i)Big Oh (ii) Omega (iii)Theta 85. -4. What is NP Hard and NP Complete ?Explain with example.Initial arrangement of tiles is given below 111) Prove using the formal definition of Big O.Explain any 2. What is Multi Stage Graph Problem? How does dynamic problem help in solving it 101. 102)Write an algorithm to find nth minimum and maximum element using divide and conquer strategy 103)What is Traveling Salesperson Problem?.Find the solution of the following salesman problem 104)calculate the number of swaps to sort the following data using bubble sort 5. 99. 106)What is criterion function and solution space of Backtracking? Explain and solve four Queen's problem using Backtracking 107)Explain in detail various Set algorithms 108)What is Greedy method? Give general algorithm for it. Solve 0/1 knapsack Problem using Greedy Method.Find the solution of the following Traveling Salesperson Problem ?. Solve 0/1 knapsack Problem using Dynamic Programming. Explain the algorithm for Quick Sort . 94. 96. 93. 15. 1 105)give pictorial representation of each pass.. 114) Explain the following algorithm design techniques . State and write Knapsack problem using Greedy Method 109)Give State space representation for 4 Queen's problem. 2. 97.Course File . Explain evaluation and interpolation with example.n0) 3n-10=Omega(n) n2-5n-20=Omega(n 2) 113) By taking suitable example explain how the sum of Subset problem can be solved by using Backtracking algorithm design technique. 95. 3.On what input does Quick Sort exhibit its worst case behavior 100. Differentiate between Deterministic and Non Deterministic Algorithms.c. 19 | P a g e . Number the nodes as in (i)DFS (ii)BFS 110) Solve 15 Puzzle Problem using Branch and Bound . Write short notes on (i) Approximation Algorithms (ii) Combinatorial Algorithms 91.Design & Analysis of Algorithms with example Solve 4 Queens Problem using Backtracking What is dynamic Programming.. What is Multi Stage Graph Problem What do you mean by sorting .What are various sorting Techniques . -10. 92.n0) 5n-3=O(n) 2n2+3n+20=O(n 2) 112) Prove using definition of Omega( you need to give a . 0.c. 98.(you need to give a . P2.3) 119) Define Optimal Merge Pattern .P3.27) (D1.2.25.53. 124) What is Clique Decision Problem. 132) What do you mean by dynamic programming.P4)=(100.10) 117) Define Job Sequencing with Deadlines .12.W2. 130) What is Divide and Conquer algorithm.M7)with relative frequencies (q1.L3)=(5. Show that clique optimization reduces to clique decision problem.. Prove that P is a subset of NP. 121) Define the Traveling Salesperson Problem . 123) Define NP Hard and NP Complete .m=20 (P1.W3)=(18. 127) Discuss advantages and disadvantages of each 128) What is data structure ?Explain various data structures with examples 129) Write algorithm for Quick Sort using divide and Conquer ...3..Find Optimal Merge pattern for 10 files whose lengths are 28.15) (W1.10. Solve the following using Knapsack Problem n=3.Solve the following problem using Job Sequencing with Deadlines: n=4.1.Represent the relation between them.32.8.1) 118) Define Optimal Storage on Tapes.L2.P2.Design & Analysis of Algorithms (i)Backtracking (ii)Branch and Bound (iii)Dynamic Programming (iv)Divide and Conquer 115) Write and explain the algorithms for Disjoint Set Union if we are given two sets Si and Sj 116) Define Knapsack problem. What are various String Algorithms. Write example for each of them...15.Solve problem using TSP where the edge lengths are given as: 0 10 15 20 5 6 8 0 13 8 9 0 9 10 12 0 122) What do you mean by deterministic and Non Deterministic Algorithms.10..15.Draw the decode tree for this set of codes.Write the various performance analysis techniques of Algorithm .D2.91.20).q7)=(4. (L1.(P1.7.10. Explain any two of them. Differentiate between them.Course File . 125) What are approximation Algorithms.P3)=(24. Define absolute approximation and Eapproximation with example.12..5. Use this algorithm to find maximum and minimum from a given array 131) Write an algorithm for Merge Sort using Divide and Conquer.D3..84. Explain multistage Graphs using dynamic Programming 133) What are Strings.5. Solve the following using this technique: n=3.11 120) Obtain a set of Optimal Huffman Codes for the messages(M1.35. 126) What is Algorithm ..D4)=(2. 20 | P a g e . Explain how does it holds on the following problems: knapsack Optimal Merge Pattern Shortest Path 21 | P a g e .Design & Analysis of Algorithms 134) Explain 0/1 knapsack problem using any two techniques you know 135) Explain asymptotic notations .Show that a graph is 4 color able 145) What do you mean by Branch and Bound. Explain various problems solved by backtracking 140) What is Backtracking. Explain it with example . Solve 8 Queens problem by backtracking 141) Explain various search techniques for trees 142) Explain various search techniques for graphs 143) How sum of subset problem is solved by Backtracking 144) What is graph coloring. Solve 15-puzzle problem 146) Define the following LC Search FIFO Branch and Bound LC branch and Bound 147) Define Principle of Optimality .Course File .Also explain the following notations: Big O Omega Theta 136) What do you mean by complexity of an algorithm .Define time and space complexity with examples 137) Explain various traversal techniques for trees 138) Explain various traversal techniques for graphs 139) What is Backtracking. Design & Analysis of Algorithms UNIVERSITY QUESTION PAPERS 22 | P a g e .Course File . x Mn. What are Union Find Problems? i). Explain the relationship between Turing Machine and RAM models. 5). 23 | P a g e . (iii) Post order. What is the time complexity of Merge Sort? g). Describe a path in an undirected graph. 9). NP Hard and NP complete problems? Explain by giving an example of each. What is Pattern Matching? j). What is NP Complete Problem? Section-B 2). What is asymptotic time complexity? c). 6). 3). determine all occurrences of y in x. (a) Explain the algorithm for Fast disjoint set union algorithm. h). What are Stored RAM model? d). Define post order traversal of a tree. (a) What are string matching algorithms? (b) Given a text string x and pattern string y.Design & Analysis of Algorithms Design and Analysis of Algorithms (CS-307. Dec-07) Section-A 1). What are position trees? Describe using examples. What are NP. Write an algorithm to print the names in (i) Pre-order. a). What do you understand by Algorithm Evaluation? b). f). Explain the algorithm of a non-deterministic finite automation. 8). (b) Give an example of NP-Complete Problem. Give an example of Dynamic Programming Approach. Section-C 7). (a) Consider a Binary tree with names attached to the vertices.Course File . 4). e). Describe the Dynamic Programming algorithm for computing the minimum cost order of multiplying a string of n matrices M1 x M2 x M3……. (b) How binary tree can be used for searching an element? Explain. (ii) Inorder. h) Given an example of an algorithm which is infinite in nature.C (2x10=20) Q6)Find the shortest path from node 1 to all vertices of the graph given below' Show all the intermediates teps.Course File . Section. g) Define recurrencere lation. of Questions : 9 Total No. Q8) Deftne a minimum spanning tree.B (4x5=20) Q2)Differentiate betu'een N-P hard and N-P complete problems with example' Q3)Find lower bound for multiplying m x n matrix with n x 1 vector' Q4)Write a algorithm for Quick sort and complexity' Q5)Explain how the knapsack problem can be solved using branch and bound algorithms.A is Compulsory. of Pages : 02 Paper ID [A 0467] (Please fill this Paper ID in OMR Sheet) B.Design & Analysis of Algorithms Roll No.307) Time : 03 Hours Instruction to Candidates: 1) Section .B. Maximum Marks : 60 Section . i) Namet hreec onditionsu nderw hich sequentiasl earcho f a list is preferable to binarv search. – 5th) DESIGN AND ANALYSIS OF ALGORITHMS (CS .Tech. 2) Attempt any Four questionsf rom Section. Write Prim's algorithm to find minimum spanning tree. Total No. j) What is an algorithm? Section . 24 | P a g e .T he numberso n the edgesa re the weights' Q7) Compare general and recursive back tracking methods and also write a algorithm to find all Hamiltoman cycle for graph using back tracking method. Q9) Write short note on following: (a) Techniques for algebraic problems (b) Polynomial time algorithm.A QI) (10x2 =20) a) Define Big Omega Notation and Little Omega Notation .C. 3) Attempt any Tlvo questionsf iom Section. (Sem. b) What is re-entrantp rogram? c) What is Akermann's function give example? d) What is the basic principal of Divide and Conquer? e) What is stable sorting? f) Differentiate between Top-down and Bottom-up approach. Q9) Define a minimum spanning tree.A QI) (10x2=20) a)Define Big oh Notation (O) and Little oh Notarion (o). of Questions: 09 Total N o. Section .A is Compulsory. g) What is a solution space in the backtracking? h) Given an example o f an algorithm which is infinite in nature.< 11 010 00010 10001010100 010 >.20. Section .B. j) State the knapsack problem using branch and bound technique. of pages: 02 DESIGN AND ANALYSIS OF AI-GORITHMS SUBJECT CODE : CS . Q4) Write a recursive algorithm for Binary search Tree and complexity.4. 25 | P a g e .3. I b) What is re-entrant program? c) What is NP complete? d) What are row major and column major ordering? e)What is the purpose ofAVL Tree? f)Differentiate between space complexity and Time space tradeoff. Q8) What do you mean by dynamic programming?Explain assignment problem with example. 2) Attempt any Four questions from Section .307 Paper ID IA 0467l Time : 03 Hours Maximum Marks : 60 Instruction to Candidates: 1) Section.100. Support your arguments with an example and analysis.11. (b) Using Knuth-Marries-pratt algorithm find whether the pattern P : <0010> is in the text T . Section .C.C (2 x 10:20) Q6) Sortt he following usingG eapsortte chniqueL :'-5. Q3)Among Merge sort. Insertion sort and Bubble sort which sorting technique is the best in worst case. Write Kruskal's algorithm to find minimum Spanning tree. TotalN o.8.B (4x5:20) Q2) Does greedy algorithm always give an optimal solution?Give arguments to support your answer. 3) Attempt any Two questions from Section . i) Name the three conditions under which sequential search of a list is preferable to binary search. Q7) (a) What are approximation algorithms?Explain approximation vertex cover. Q5) What aret he featureso f brancha nd bounda lgorithms?D iscussi n detail.Course File .9.3>0.Design & Analysis of Algorithms Roll No. j) Give an €xample of an algorithm which is infinite in nature..307 Paper ID I IA0467l [Note: Pleasefi ll subjectc odea nd paperI D on OMRI Time : 03 Hours Instruction to Candidates: 1) Section ... e) What is re-entrant program? 0 What is stable sorting? g) Differentiate between NP-Hard and Np-Complete. Total No...20) Q2) Differentiate between deterministic and non-deterministic algorithms? Q3) Explain how the knapsack problem can be solved using branch and bound algorithms..A is Compulsory. Q4) Explain the backtracking problem with the help of suitable example? Q5) Explain how to validate and analyze the algorithms. h) What do you mean by worst case analysis? i) Define Non-deterministic algorithm..r.A' QI) a) Explain the term the order of complexity. of Pages: 02 B.....( Sem. 26 | P a g e . Maximum Marks : 60 (10x2-20) Section – B (4 x. d) Explain the asymptotic notation.. NP-hard and NP-complete problems..Course File . Q9) What do you mean by complexity of an algorithm? Define time and space complexity with examples.. Q8) Explain in detail the structure of string storage.. ..Design & Analysis of Algorithms Roll No. of Questions : 09 TotalN o.5th) DESIGN AND ANALYSIS OF ALGORITHMS SUBJECT CODE : CS .. 3) Attempt any Two questions from Section .. Section-C (10x2-20) Q7) Explain in detail basic concepts of P.5 . 2) Attempt any Four questions from Section . Tech. Q6) Explain the algorithm of a non-deterministic finite automation..C. Design an algorithm which finds number of words. NP. b) Give the general characteristics of greedy algorithm" c) Describe the general principle of Divide and conquer..B. lines and characters in a given text. Section . Design & Analysis of Algorithms VIVA .Course File .VOICE QUESTION 27 | P a g e . 6. Polyphase sort. 4.Design & Analysis of Algorithms 1. Natural merging.     What are the methods available in storing sequential files ? Straight merging. A binary tree with 20 nodes has 21 null branches? Let us take a tree with 5 nodes (n=5) Null Branches It will have only 6 (ie. What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms? Polish and Reverse Polish notations. Sorting is not possible by using which of the following methods? (a) Insertion (b) Selection (c) Exchange (d) Deletion (d) Deletion. Prefix Notation: ^ . How many different trees are possible with 10 nodes ? 1014 28 | P a g e .FG + ^ 3.DE + FG Postfix Notation: AB + C * DE .Course File .* +ABC . In general. 5. Distribution of Initial runs. Convert the expression ((A + B) * C – (D – E) ^ (F + G)) to equivalent Prefix and Postfix notations.5+1) null branches.. 2. A binary tree with n nodes has exactly n+1 null nodes. Note: Full and Complete binary trees are different. So the correct answer is 15.Course File . Which of them could have formed a full binary tree? 15. 15. 14 nodes were there in 4 different trees.3 = 5) trees. using array you can store the node 4 at which location? 1 2 4 5 3 29 | P a g e . All full binary trees are complete binary trees but not vice versa 10. there exist 2n-n different trees. In tree construction which is the suitable efficient data structure? (a) Array (b) Linked list (c) Stack (d) Queue (e) none (b) Linked list 8. 7. so rejected. i ii iii iv v In general: If there are n nodes. In general: There are 2n-1 nodes in a full binary tree. What is the type of the algorithm used in solving the 8 Queens problem? Backtracking 9. 23 . In the given binary tree. it will have the maximum combination of 5 different (ie. So there cannot be full binary trees with 8 or 14 nodes. consider a tree with 3 nodes(n=3). There are 8. 13.Design & Analysis of Algorithms For example. By the method of elimination: Full binary trees contain odd number of nodes. With 13 nodes you can form a complete binary tree but not a full binary tree. 30 | P a g e . 65 70L 75 80 85 60 55 50 45R Since pivot is not yet changed the same process is continued after interchanging the values at L and R positions 65 45 75 L 80 85 60 55 50 R 70 65 45 50 80 L 85 60 55 R 75 70 65 45 50 55 85 L 60 R 80 75 70 65 45 50 55 60 R 85 L 80 75 70 When the L and R pointers cross each other the pivot value is interchanged with the value at right pointer. If the pivot is changed it means that the pivot has occupied its original position in the sorted order (shown in bold italics) and hence two different arrays are formed. Sort the given values using Quick Sort? 65 70 75 80 85 60 55 50 45 Sorting takes place from the pivot value. one from start of the original array to the pivot position-1 and the other from pivot position+1 to end. this is marked bold.Design & Analysis of Algorithms At location 6 1 2 3 4 5 Root LC1 RC1 LC2 RC2 LC3 RC3 LC4 RC4 where LCn means Left Child of node n and RCn means Right Child of node n 11.Course File . The values at the left pointer and right pointer are indicated using L and R respectively. which is the first value of the given elements. Of the following tree structure. For the given graph.Course File . 45 50 55 60 65 70 75 80 85 12. which is. draw the DFS and BFS? The given graph: A X H E G P M J Y  BFS:  DFS: AXGHPEMYJ AXHPEYMJG 13. efficient considering space and time complexities? (a) Incomplete Binary Tree (b) Complete Binary Tree (c) Full Binary Tree 31 | P a g e .Design & Analysis of Algorithms 60 L 45 50 55 R 65 85 L 80 75 70 R 55 L 45 50 R 60 65 70 R 80 L 75 85 50 L 45 R 55 60 65 70 80 L 75 R 85 In the next pass we get the sorted form of the array. Minimal spanning tree assures that the total weight of the tree is kept at its minimum. What is a spanning Tree? A spanning tree is a tree associated with a network. So complete binary tree is the better one since the property of complete binary tree is maintained even after operations like additions and deletions are done on it. But it doesn’t mean that the distance between any two nodes involved in the minimumspanning tree is minimum.Design & Analysis of Algorithms (b) Complete Binary Tree. Convert the given graph with weighted edges to minimal spanning tree.Course File . For incomplete binary trees. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized. Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes? No. 1 410 2 600 612 2985 1421 3 310 200 5 400 4 the equivalent minimal spanning tree is: 1 3 612 310 4 200 5 410 2 32 | P a g e . 16. 14. 15. All the nodes of the graph appear on the tree once. By the method of elimination: Full binary tree loses its nature when operations of insertions and deletions are done. extra storage is required and overhead of NULL node checking takes place. Design & Analysis of Algorithms TUTORIAL SHEETS 33 | P a g e .Course File . 8. What is time complexity ? 5. Give the definition for 0/1 knapsack problem.1 1. Explain the backtracking Problem with 4 Queens on a 4*4 chess board.2 1. Define the term Divide and Conquer. What are the various methods or techniques in which various algorithms can be expressed? TUTORIAL SHEET . What is the worst case running time of Quick Sort? 3. 6. 3. 10. 18. What is recursion?What are its drawbacks? 8. 2.Also explain the following notations: Big O Omega Theta 7. 16. Explain asymptotic notations . 9. What is the worst case running time of algorithm to delete each element from the linked list? 4. 10. What are the advantages of dynamic programming over greedy method? What are the conditions under which backtracking can be used? What is solution space in Backtracking Techniques ? How will Merge Sort sort the 6 numbers: 40.list all substrings of W.find out the shortest distance of all the nodes from the node A . If W= MNOP. by divide and conquer technique. The order of complexity of Binary Search in Best case is -----in the average case is -----in the worst case is -------9. 5. In the following Graph . Is 2n+1=O(2n)? 2. 10. 4.Design & Analysis of Algorithms TUTORIAL SHEET .Explain with the help of suitable algorithms. 20 .62. 7.Course File . Write an string processing algorithm to identify whether a particular sequence of character is in string or not. What is criterion function in backtracking? What is solution space for backtracking problem? Explain by taking sum of subset as a problem 34 | P a g e . What is space complexity? 6. 2. 2.P2. (L1. Define Optimal Storage on Tapes. Solve 15 Puzzle Problem using Branch and Bound . 35 | P a g e .1.10. Solve the following using this technique: n=3.P4)=(100.Course File . Explain in detail various Set algorithms 7. 3.1) 9.L3)=(5.3) 10.L2. Define Prim's and Kruskal Algorithms What is NP Hard and NP Complete ?Explain with example. What is Clique Decision Problem.27) (D1.Design & Analysis of Algorithms TUTORIAL SHEET – 3 1. What is Multi Stage Graph Problem? How does dynamic problem help in solving it Write short notes on (i) Approximation Algorithms (ii) Combinatorial Algorithms 6. 4.D3.15. Define Job Sequencing with Deadlines .10.P3.D2.D4)=(2.(P1.Solve the following problem using Job Sequencing with Deadlines: n=4. Show that clique optimization reduces to clique decision problem.Initial arrangement of tiles is given below 8. 5. Differentiate between Deterministic and Non Deterministic Algorithms. Documents Similar To Daa Course File Final 2012Skip carouselcarousel previouscarousel nextLecture 2Data Structure - Lecture 1 Introduction]IRJET-A Review on Complexity Results for Some Eigenvector ProblemsData StructuresComputational Geometry Methods and Applications - ChenCse-IV-Design and Analysis of Algorithms [10cs43]-NotesPs1 Solution(VERY IMP)Evaluate AlgorithmsTechinical TermsOOPS Lab ManualbocaTheory of Computation Aqa OcrMerge SortDAA Course File210CT Revision NotesIcalp99Fullch101998 Galve-FrancesEtAl AlgorithmDesignByPatternsS.Y.B.Sc.(Computer Science) Practical Examination DocA Novel Sorting Technique to Sort ElemenAds a Lab ManualB.tech MDU Syllabus (CSE)IP CSE 205Computer science C++daaPython Lab Manual FinalDS Programming Assignementn Jobs and M- Machine Problem1 IntroductionMore From gurusodhiiSkip carouselcarousel previouscarousel nextSM Tutorial Sheet-1evolution of Computer networks.pdfMS Word 2007 Practical Notes_08!09!2014Systems Multimedia- A SummarySM Tutorial Sheet-2Perspectives on Big DataRelational Databse Notes.docusbvirusfolderundelete-111110021717-phpapp02.pdfRDBMS_Notes.docRdbms NotesMs Excel McqStatistics TutorialVirus creation for USB .pdfMultimedia-Systems_final.docRelational Algebra NewIntegrity Enhancement in Wireless Sensor Networksrm_question_bank_iisem.pdfAODV & DSRGateway-Based Energy-Aware Multi-Hop Routing Protocol for WSNsRM_Intro.pdfRouting_WSN0811.4349.pdfNetEye5.pdfNSDI07.pdf0112ijassn01.pdfNet Mag PaperEnergy Aware Routing_WSNA Variant of LEACH for WSNssensors-wsnFooter MenuBack To TopAboutAbout ScribdPressOur blogJoin our team!Contact UsJoin todayInvite FriendsGiftsLegalTermsPrivacyCopyrightSupportHelp / FAQAccessibilityPurchase helpAdChoicesPublishersSocial MediaCopyright © 2018 Scribd Inc. .Browse Books.Site Directory.Site Language: English中文EspañolالعربيةPortuguês日本語DeutschFrançaisTurkceРусский языкTiếng việtJęzyk polskiBahasa indonesiaSign up to vote on this titleUsefulNot usefulMaster Your Semester with Scribd & The New York TimesSpecial offer for students: Only $4.99/month.Master Your Semester with a Special Offer from Scribd & The New York TimesRead Free for 30 DaysCancel anytime.Read Free for 30 DaysYou're Reading a Free PreviewDownloadClose DialogAre you sure?This action might not be possible to undo. Are you sure you want to continue?CANCELOK
Copyright © 2024 DOKUMEN.SITE Inc.