Documente Academic
Documente Profesional
Documente Cultură
: II YEAR/IV SEM
UNIT I
INTRODUCTION
SYLLABUS
(X)* Notion of an Algorithm Fundamentals of Algorithmic Problem Solving
Important Problem Types Fundamentals of the Analysis of Algorithm Efficiency
(Y)*
PART A
I X1. What is time and space complexity?
I X2. What is an Algorithm?
I X3. Define program proving and program verification.
I X4. Define algorithm validation.
I X5. Write an algorithm to find the number of binary digits in the binary representation of a positive
decimal integer.
I X6. Give the notation of an algorithm.
I X7. Design a Euclids algorithm for finding GCD of two given numbers.
I X8. What are Sequential Algorithms?
I X9. What are Parallel Algorithms?
I X10. Write the process for design and analysis the algorithm.
I X11. What are the fundamentals steps for design and analysis an algorithm?
I X12. What is Exact and Approximation algorithm?
I X13. What is Algorithm Design Technique?
I X14. Define Pseudo code.
UNIT II
SYLLABUS
Divide and conquer methodology Merge sort Quick sort Binary search
PART A
II X 1. Give the mathematical notation to determine if a convex direction is towards left or right and write
the algorithm.
II X 2. Design a brute force algorithm for computing the value of a polynomial
p(x) = anxn + an-1xn-1 +.......+ a1x......a0 at a given point x0 and determine its worst case efficiency
class.
II X 3. Define Brute force strategy.
II X 4. Define closest pair problem.
II X 5. Mention the time complexity of closest pair problem using brute force strategy. Define Convex
hull problem.
II X 6. Determine the sets which are convex.
a.Star b.Cone c. Pentagone d. Semi Circle e. Arc.
II X 7. What is the time complexity of the algorithm which can solve the convex-hull problem using the
brute force method?
II X 8. What is meant by exhaustive search?
II X 9. Give an example for exhaustive search algorithm.
II Y 1. Derive the complexity of Binary Search algorithm.
II Y 2. Define divide and conquer strategy.
II Y 3. Give the recurrence relation for divide and conquer.
II Y 4. Define Master Theorem.
II Y 5. Find the order of growth for the following recurrence.
T(n)=4T(n/2)+n2, T(1)=1
II Y 6. Give some examples for divide and conquer method.
II Y 7. Write the control abstraction for divide and conquer technique.
II Y 8. What is the best case, worst case and average case complexity of Quicksort?
II Y 9. Solve the average case recurrence for quick sort.
II Y 10. How to search an element using binary search?
II Y 11. What are the merits of binary search?
II Y 12. What are the merits of divide and conquer technique?
II Y 13. What are the demerits of binary search?
II Y 14. What is the best case, worst case and average case complexity of binary Search?
II Y 15. Compute 2101*1130 by applying the divide and conquer algorithm.
II Y 16. Prove the equality alogbc = clogba .
II Y 17. What is the time complexity of closest pair and quick hull problem?
II Y 18. Solve the average case recurrence for quick sort.
II Y 19. How the operations performed in Strassens Matrix multiplication
PART-B
II X 1. Find the optimal solution to the fractional knapsack problem with given data: (16)
Item
Weight
Benefit
60
75
90
II X 2. Write an efficient and exhaustive search algorithm for the travelling salesmen problem. (16)
II X 3. Find the optimal solution using exhaustive search method for the assignment problem given
Below. (16)
Examples:
1. Pattern: abba, input: redblueredblue should return 1
2. Pattern: aaaa, input: asdasdasdasd should return 1
3. Pattern: aabb, input: xyzabcxzyabc should return 0
II Y 1. Explain the merge sort algorithm with example.(16)
II Y 2. Explain about Quick sort algorithm. (16)
II Y 3. Write down the algorithm to construct a convex hull based on didvide and conquer strategy. (16)
II Y 4. Write the algorithm to perform Binary Search and compute its run time complexity. (16)
II Y 5. What do you mean by divide and conquer strategy? Explain with example.(12)
II Y 6. Compare the stabilities and the time complexities of quicksort and mergesort algorithms.(8)
II Y 7. Explain the binary search algorithm and time complexity of binary search algorithm.(16)
II Y 8. Write a pseudo code for obtaining the product of two matrices using the Strassens matrix
Multiplication algorithm. (8)
II Y 9. Explain the upper and lower hulls in the convex-hull problem, with an example. (8)
II Y 10. What is the best-case efficiency of quickhull? (4)
II Y 11. Give a specific example of inputs that make the quickhull algorithm run in quadratic time.(12)
II Y 12. Write a pseudo code for the quickhull algorithm.(4)
II Y 13. Write short notes on the following (16)
i.Strassens Matrix Multiplication
ii.Multiplication of largest integer.
UNIT III
(X)* Computing a Binomial Coefficient Warshalls and Floyd algorithm Optimal Binary
Search Trees Knapsack Problem and Memory functions.
(Y)*Greedy Technique Prims algorithm- Kruskal's Algorithm-Dijkstra's Algorithm-Huffman
Trees.
PART A
III X 1. Differentiate between greedy method and dynamic programming.
III X 2. Explain principle of optimality?
III X 3. Differentiate between divide and conquer and dynamic programming.
III X 4. Define optimal binary search tree.
III X 5. Write an algorithm to find the shortest path between all pairs of nodes.
III X 6. List out memory functions used under dynamic programming.
III X 7. State how Binomial Coefficient is computed?
III X 8. Write down the optimization technique used for Warshalls algorithm. State the rules and
assumptions which are implied behind that.
III X 9. Define dynamic programming.
III X 10. What is meant by all pairs shortest path problem?
III X 11. Write the running time of 0/1 knapsack problem.
III X 12. Give an application of dynamic programming algorithm.
III X 13. Give the running time of the optimal BST algorithm.
III X 14. What is meant by bottom up dynamic programming?
III X 15. Define Floyds algorithm
III X 16. What is the running time of dynamic programming TSP?
III X 17. What is the formula used used in floyds algorithm?
III X 18. What is the formula used for cost of binary search tree?
III X 19. Write recurrence relation for 0/1 knapsack problem.
III Y 1. What is meant by 0/1 knapsack problem?
Weight
Value
12
10
20
15
III X 12. Using OBST algorithm compute wi,rij,cij where j=0 to 4 for the identifier set (a1, a2,a3
,a4) = (end,goto,print,stop) with P1= 1/20,P2= 1/5,P3=1/10,P4=1/20
q0=1/5, q1=1/10,
q2=1/5 ,q3=1/20, q4 =1/20 using r ij construct optimal binary search tree. (16)
III X 13. Describe binary search tree with three traversal patterns? Give suitable example with neat
diagram for all three traversal of binary search.(16)
III X 14. Find the solution for the knapsack problem with the following instances Weights ={2,1,3,2},
Profits = {12,10,20,15} and capacity =5. (16)
III X 15. Explain about Knapsack Problem and memory functions with example. (16)
III X 16. Illustrate Floyds Algorithm for the All-Pairs Shortest-Paths Problem. (16)
III X 17. Write an algorithm for binomial coefficient computation and analyze the efficiency of
algorithm.(8)
III X 18. Apply the bottom up dynamic programming algorithm to the following instance of Knapsack
Problem. (16)
Item
Weight
Value
$42
$12
$40
$25
Capacity W=10
III Y 1. Write the kruskals algorithms apply it to find a minimum spanning tree for the following
graph.(16)
III Y 2. Explain Kruskals algorithm for constructing minimum cost spanning tree. (16)
III Y 3. Let A={l/119, m/96, c/247, g/283, h/72, f/77, k/92, j/19} be the letters and its frequency of
distribution in a text file. Compute a suitable Huffman coding to compress the data effectively. (16)
III Y 4. Write and analyze the Prims Algorithm. (16)
III Y 5. The binary string below is the title of a song encoded using Huffman codes. (12)
0011000101111101100111011101100000100111010010101.
Given the letter frequencies listed in the table below, build Huffman codes and use
them to decode the title. In cases where there are multiple greedy choices, the codes
are assembled by combining the first letters (or groups of letters) from left to right, in
the order given in the table. Also, the codes are assigned by labelling the left and right
branches of the prefix/code tree with 0 and 1, respectively.
Letter
Frequency
probability
0.5
0.35
0.5
0.1
0.4
0.2
UNIT IV
ITERATIVE IMPROVEMENT
SYLLABUS
(X)* The Simplex Method-The Maximum-Flow Problem
(Y)* Maximm Matching in Bipartite Graphs- The Stable marriage Problem.
PART A
IV X 1. Define Network Flow and Cut.
IV X 2. Define Flow Cut.
IV X 3. Determine the Dual linear program for the following LP,
Maximize 3a + 2b+c
Subject to,
2a + b + c <=3
a +b + c <=4
3a +3b +6c <=6
a, b, c>=0
IV X 1. Define optimal solution.
IV X 2. Define feasible solution.
IV X 3. Define Maximum flow time complexity.
IV X 4. Define Maximum flow Problem.
IV X 5. What is a cut?
IV X 6. How will you find minimum cut?
IV X 7. Define simplex method.
IV X 8. What are the steps involved in simplex method?
IV X 9. Define forward and backward edges
IV X 10. What is the capacity of a cut?
IV X 11. Define iterative improvement technique.
IV X 12. How maximum flow and minimum cut related to each other?
IV X 13. Define augmenting path
IV X 14. Define flow conservation requirements.
IV X 5. Maximize
IV X 11. Illustrate pictorially the Ford Fulkerson method by showing the flow augmenting
paths in bold for the given flow network. (16)
IV Y 2. Write down the optimality condition and algorithmic implementation for finding M- augmenting
paths in bipartite graphs.(16)
IV Y 3. Explain briefly on bipartite graph. (8)
IV Y 4. Write an algorithm for stable marriage problem with example.(12)
IV Y 5. Explain briefly on reducing bipartite graph to net flow. (8)
IV Y 6. Explain briefly on minimum weight perfect matching algorithm.(8)
IV Y 7. Explain the algorithm: (16)
i. Blocking pair
ii Stable marriage problem
iii Man optimal
iv Women optimal
IV Y 8. Write the algorithm for maximum matching in Bipartite Graphs and prove the theorem
With example (16)
IV Y 9. Apply the maximum matching algorithm to the following bipartite graphs (16)
IV Y 10. Explain the algorithm for stable marriage problem and prove the theorem with Example.(16)
IV Y 11. Consider an instance of the stable marriage problem given by the ranking matrix(16)
A
1,3
3,1 1,3 2, 2
2,2 3, 1
2,2 3,1 1, 3
UNIT V
SYLLABUS
(X)* Limitations of Algorithm Power-Lower-Bound Arguments-Decision Trees-P, NP and NPComplete Problems--Coping with the Limitations - Backtracking n-Queens problem
Hamiltonian Circuit Problem Subset Sum Problem
(Y)*
PART A
V X 1.
What is backtracking?
V X 2.
V X 3.
V X 4.
V X 5.
V X 6.
V X 7.
V X 8.
V X 9.
V X 24. Write the formula for decision tree for searching a sorted array.
V X 25. List the lower bounds for sorting, searching and multiplication.
V X 26. Define adversary method.
V X 27. What is information theoretic lower bound?
V X 28. Define local search heuristics
V X 29. Define the class P and NP problem.
V X 30. What is meant by tractable and intractable problem?
V X 31. Whether class P solves a problem in polynomial time? Justify.
V X 32. Give examples for NP Complete problems
V X 33. Define adversary method.
V X 34. Compare polynomial and non deterministic polynomial and give two examples for each.
V Y 1.
V Y 2.
V Y 3.
V Y 4.
What are the additional features required in branch-and-bound when compared to backtracking?
V Y 5.
V Y 6.
V Y 7.
V Y 8.
V Y 9.
Give the formula used to find the upper bound for knapsack problem.
Write down and explain the procedure for tackling the 8 queens problem using a
backtracking approach. (16)
V X 2.
V X 3.
How does backtracking works on 8 queens problem with suitable example. (16)
V X 4.
V X 5.
Write an algorithm to determine Hamiltonian cycle in a given graph using back tracking. For the
V X 6.
V X 7.
V X 8.
Using an example prove that, satisfiability of Boolean formula in 3- Conjunctive Normal Form
is NP complete. (12)
State the relationships among the complexity class algorithms with the help of neat diagrams. (8)
V X 9.
The knight is placed on the first block of an empty board and, moving according to the rules of
chess, must visit each square exactly once. Solve the above problem using backtracking
procedure. (8)
V X 10. Draw the decision tree for sorting algorithm and explain briefly. (8)
V X 11. Draw the decision tree for searching an element from the sorted array and explain it briefly.(8)
V X 12. Compare polynomial and non deterministic polynomial and give two examples for each.(16)
V X 13. Explain lower bound Arguments in detail.(8)
V X 14. Illustrate the limitations of algorithm.(16)
V X 15. Draw the Decision Tree and Find the number of Key Comparison in the worst and average
case for: (16)
1. The four Element Binary search
2.
V X 17. Explain
i)Describe in detail about P and NP Problems
ii)Write short notes on NP Complete Problem (16)
V Y 1. Show that the Hamiltonian path problem reduces to the Hamiltonian Circuit Problem and vice
versa. (16)
V Y 2. Explain how job assignment problem could be solved, given n tasks and n agents where each agent
has a cost to complete each task, using Branch and Bound technique. (16)
V Y 3. Suggest an approximation algorithm for TSP. Assume that the cost function satisfies the triangle
inequality. (16)
V Y 4. What is an approximation algorithm? Give example. (16)
V Y 5.
Explain the Assignment problem in Branch and bound with Example. (16)
V Y 6.
Solve the following instance of Knapsack problem by Branch and bound Algorithm (16)
V Y 7.
Apply the branch and bound algorithm to solve the traveling salesman problem for the following
Graph(16)
V Y 8.
V Y 9.
Describe in detail about Twice around the tree algorithm with example(8)