DAA Syllabus
DAA Syllabus
DAA Syllabus
2
Assignment 1: Algorithm Analysis and Time Complexity
Title: Asymptotic Analysis of Sorting Algorithms
Objective: Compare the time complexity of two sorting algorithms - Insertion Sort and
HeapSort.
Steps:
1. Provide a brief overview of Insertion Sort and Heap Sort algorithms.
2. Analyze the time complexity of each algorithm in terms of Big O notation.
3. Discuss the best-case, worst-case, and average-case scenarios for both
algorithms.
4. Compare the efficiency of Insertion Sort and Heap Sort based on their time
complexities.
5. Discuss any trade-offs or advantages one algorithm may have over the other.
Assignment 2: String Matching Algorithms
Title: Comparative Analysis of String-Matching Algorithms
Objective: Analyze and compare the string-matching algorithms - Naïve String
Matching,Rabin-Karp, and Knuth-Morris-Pratt.
Steps:
1. Provide a brief overview of each string-matching algorithm.
2. Analyze the time complexity of Naïve String Matching, Rabin-Karp, and Knuth-
Morris-Pratt.
3. Discuss the best-case, worst-case, and average-case scenarios for each algorithm.
4. Compare the strengths and weaknesses of the algorithms, considering factors
likepattern length and text size.
Provide examples or scenarios where each algorithm may be most suitable.
Assignment 3: Divide and Conquer and Dynamic Programming
Title: Comparative Study of Divide and Conquer vs. Dynamic Programming
Objective: Analyze and compare the efficiency of Divide and Conquer and Dynamic
Programming approaches in solving two different problems - Finding Maximum and
Minimum, and Matrix-Chain Multiplication.
Steps:
1. Finding Maximum and Minimum:
• Explain the Divide and Conquer approach for finding the maximum
andminimum in an array.
• Analyze the time complexity of the Divide and Conquer solution.
• Discuss any limitations or scenarios where this approach might be
preferable.
2. Matrix-Chain Multiplication:
• Describe the Dynamic Programming approach for solving the Matrix-
ChainMultiplication problem.
• Analyze the time and space complexity of the Dynamic Programming
solution.
• Discuss the advantages of using Dynamic Programming in this context.
3. Comparison:
• Compare the Divide and Conquer and Dynamic Programming
approachesin terms of time and space complexity.
Discuss scenarios where one approach might be more suitable than the other.
TOTAL: 75 PERIODS
COURSE OUTCOMES:
CO1: Understand the fundamental principles of problem solving and analyse the efficiency of
algorithms using various frameworks
CO2: Apply Greedy Technique to Solve real time problems
3
CO3: Implement and evaluate various Divide and Conquer and Dynamic Programming Techniques
CO4: Apply Backtracking techniques to solve real-world problems.
CO5: Evaluate and Solve problems using approximation algorithms and randomized algorithms
TEXTBOOKS:
1. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford Stein,
"Introduction to Algorithms", 3rd Edition, Prentice Hall of India, 2009.
2. Ellis Horowitz, Sartaj Sahni, Sanguthevar Rajasekaran “Computer Algorithms/C++”
Orient Blackswan, 2nd Edition, 2019.
REFERENCES:
1. Anany Levitin, “Introduction to the Design and Analysis of Algorithms”, 3rd Edition,
PearsonEducation, 2012.
2. Alfred V. Aho, John E. Hopcroft and Jeffrey D. Ullman, "Data Structures and Algorithms",
ReprintEdition, Pearson Education, 2006.
3. S. Sridhar, “Design and Analysis of Algorithms”, Oxford university press, 2014.
PRACTICAL EXERCISES:
1. Implement Linear Search. Determine the time required to search for an element. Repeat the
experiment for different values of n, the number of elements in the list to be searched and plot a
graph of the time taken versus n.
2. Implement recursive Binary Search. Determine the time required to search an element. Repeat
the experiment for different values of n, the number of elements in the list to besearched and
plot a graph of the time taken versus n.
3. Given a text txt [0...n-1] and a pattern pat [0...m-1], write a function search (char pat [ ], char
txt [ ] ) that prints all occurrences of pat [ ] in txt[ ]. You may assume that n>m.
4. Sort a given set of elements using the Insertion Sort and Heap sort methods and determine
the time required to sort the elements. Repeat the experiment for different values of n, the
number of elements in the list to be sorted and plot a graph of the time taken versus n.
B. Graph Algorithms
3. From a given vertex in a weighted connected graph, develop a program to find the shortest
paths to other vertices using Dijkstra’s algorithm.
4.Find the minimum cost spanning tree of a given undirected graph using Prim’s algorithm.
4
6.. Compute the transitive closure of a given directed graph using Marshall's algorithm.
1. Develop a program to find out the maximum and minimum numbers in a given list of n numbers
using the divide and conquer technique.
2. Implement Merge sort and Quick sort methods to sort an array of elements and determine the
time required to sort. Repeat the experiment for different values of n, the number of elements in
the list to be sorted and plot a graph of the time taken versus n.
1. Implement any scheme to find the optimal solution for the Traveling Sales person problem and
then solve the same problem instance using any approximation algorithm and determine the
error in the approximation.
2. Implement randomized algorithms for finding the kth smallest number. The programs can be
implemented in C/C++/JAVA/Python.
Practicals:30 Periods