Insertion sort and selection sort algorithms are run on the two arrays : U=[1,2,3,4,5,6] and V=[6,5,4,3,2,1]. Which algorithm runs fast on U array and which on V array? Justify your answers.
Other Or UnclassifiedSource quality review required
Anna University
| University | Anna University |
|---|---|
| Degree | B.Tech. Information and Technology |
| Department | Information and Technology |
| Regulation | Regulation 2012 |
| Semester | 4 |
| Subject Code | IT8401 |
| Subject Name | ALGORITHMICS |
| Exam Session | April / May 2014 |
| Duration | 3 Hours |
| Maximum Marks | 100 |
Access the previous year question paper for your examination preparation.
View / Download PDFBrowse other previous year question papers for this subject.
View All Subject Question PapersAutomatically extracted historical question data. Academic accuracy and examination rules require verification.
| Part | Required answers | Marks per answer | Section total |
|---|---|---|---|
| A | 10 | 2 | 20 |
| B | 5 | 16 | 80 |
Proportional to section marks. This estimate uses the full exam duration without a separate reading or revision reserve.
Detected alternatives only. Confirm the actual choice rules in the original question paper.
Insertion sort and selection sort algorithms are run on the two arrays : U=[1,2,3,4,5,6] and V=[6,5,4,3,2,1]. Which algorithm runs fast on U array and which on V array? Justify your answers.
Other Or UnclassifiedSource quality review required
Show that selecting an i t h largest element can be done in linear time.
DerivationSolve the recurrence T(n) = 9 T( n/3) + n using master method.
NumericalSource quality review required
Write the properties of big- Oh notation.
Other Or UnclassifiedList the key ingredients for an optimization problem to be solved using dynamic programming technique.
Short DescriptionDefine the greedy choice property.
DefinitionState the fundamental theorem of linear programming.
Short DescriptionList the four main reasons by which a linear program is not in standard form.
Short DescriptionWhen do you say a language L, is polynomial time reducible to language L2?
Other Or UnclassifiedSource quality review required
State any one NP complete problem.
Short Descriptioni) Explain asymptotic notations in detail with suitable examples.(8) ii)Develop a recursive algorithm to sort 'n' numbers using quick sort. Solve its recurrence relation using substitution method.(8)
Other Or UnclassifiedSource quality review required
a) i) Write an algorithm to perform insertion sort and derive its time complexity.(8) ii) Write an algorithm to perform binary search on a sorted array. Find its best, worst and average case complexities.(8)
Other Or UnclassifiedSource quality review required
b) i) Develop a recursive algorithm to select the maximum and minimum element in an array using divide and conquer approach and derive its time complexity and compare it with the straight forward MaxMin algorithm.(IO) ii) Trace the algorithm for finding max and min using divide and conquer approach for the given list of elements and find how many comparisons have been made.(6) 1 0 , - 2 0 , 8 , 1 7 , 2 , - 2 3 , 2 0 , 2 3
Other Or UnclassifiedSource quality review required
a) i) State and explain matrix-chain multiplication problem. Develop an algorithm to compute an optimal order for multiplying a chain of matrices.(8) ii) Find an optimal parenthesization of a matrix chain product whose sequence of dimensions is < 5,10, 3, 2, 4 >.(8)
Other Or UnclassifiedSource quality review required
b) i) Write a brief note on the elements of greedy strategy.(8) ii) Design an algorithm to generate Huffman code and show the encoding of each character for the following frequency of characters.(8) A: 8; B: 6; C: 2; D: 5, E: 12
Other Or UnclassifiedSource quality review required
a) i) Write an algorithm to perform LU decomposition of a matrix and apply the same for the given matrix.(8) 4 - 5 6 8 - 6 7 12 -7 12 V. J ii) Explain Knuth-Morris-Pratt pattern matching algorithm and compute the prefix function for the pattern P = aababaabab.(8)
Other Or UnclassifiedSource quality review required
b) i) Write the necessary algorithms to solve a linear programming problem using SIMPLEX method.(8) ii) Solve the linear program using SIMPLEX algorithm.(8) Maximize -5x-t - 3 x 2 subject to X, - x 2 < 1 2x! + x 2 < 2 X i , x 2 £ 0
Other Or UnclassifiedSource quality review required
a) i) What are randomized algorithms? Explain the hiring problem and prove that its randomized version can be solved with a total hiring cost of O (In n).(8) ii)State any one NP complete problem and prove that it is NP complete with all the assumptions made.(8)
Other Or UnclassifiedSource quality review required
b) i)Write a brief note on approximation algorithms.(4) ii)Design an algorithm to solve Travelling salesman problem and compute its approximation ratio.(12)
Other Or UnclassifiedSource quality review required
Historical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.