CS3401-Algorithms Lab Manual
CS3401-Algorithms Lab Manual
CHENNAI-600119
Name : ______________________________
Register No : ______________________________
Batch : ______________________________
JEPPIAAR NAGAR, RAJIVGANDHI SALAI
CHENNAI-600119
_____________.
To excel in teaching and learning, research and innovation by promoting the principles of scientific analysis and creative
thinking.
To participate in the production, development and dissemination of knowledge and interact with national and
international communities.
To equip students with values, ethics and life skills needed to enrich their lives and enable them to contribute for the
progress of society.
To prepare students for higher studies and lifelong learning, enrich them with the practical skills necessary to excel as
future professionals and entrepreneurs for the benefit of nation’s economy.
Program Outcomes
COURSE OUTCOMES (CO)
CO1 Analyze the efficiency of algorithms using various frameworks.
CO2 Apply graph algorithms to solve problems and analyze their efficiency.
CO3 Make use of algorithm design techniques like divide and conquer, dynamic programming and greedy
techniques to solve problems.
CO4 Use the state space tree method for solving problems.
CO5 Solve problems using approximation algorithms and randomized algorithms
INDEX
Result:
The pattern matching algorithm accurately found pattern positions, with time increasing
linearly with text and pattern size.
Exp. No: 4 SORT A GIVEN SET OF ELEMENTS USING THE INSERTION SORT AND
Date: HEAP SORT METHODS
Result:
Insertion Sort and Heap Sort were implemented; results showed Insertion Sort was efficient
for small datasets, while Heap Sort performed better on larger inputs.
Exp. No: 5 IMPLEMENT GRAPH TRAVERSAL USING BREADTH FIRST SEARCH
Date:
Result:
Breadth First Search (BFS) was implemented for graph traversal, and the experiment
showed that all reachable nodes were visited level by level efficiently.
Exp. No: 6 IMPLEMENT GRAPH TRAVERSAL USING DEPTH FIRST SEARCH
Date:
Result:
Depth First Search (DFS) was implemented for graph traversal, and the experiment
demonstrated efficient exploration of all nodes by going as deep as possible before
backtracking.
Exp. No: 7 DEVELOP A PROGRAM TO FIND THE SHORTEST PATHS TO
Date: OTHER VERTICES USING DIJKSTRA’S ALGORITHM
Result:
Dijkstra’s algorithm was implemented to find the shortest paths from a source vertex, and
the experiment showed accurate and efficient computation of minimum distances to all
other vertices.
Exp. No: 8 DEVELOP A PROGRAM TO FIND MINIMUM SPANNING
Date: TREE OF UNDIRECTED GRAPH USING PRIM’S ALGORITHM
Result:
Prim’s algorithm was implemented to find the Minimum Spanning Tree (MST) of an
undirected graph, and the experiment showed successful construction of an MST with
minimum total edge weight.
Exp. No: 9 IMPLEMENT FLOYD’S ALGORITHM FOR THE ALL-PAIRS- SHORTEST-
Date: PATHS PROBLEM
Result:
The shortest path distances between all pairs of vertices are successfully computed and
stored in a matrix, where each element represents the shortest distance between two vertices.
Exp. No: 10 COMPUTE THE TRANSITIVE CLOSURE OF A GIVEN DIRECTED GRAPH
Date: USING WARSHALL'S ALGORITHM
Result:
The transitive closure matrix indicates which vertices are reachable from other vertices,
where a 1 represents a reachable path and a 0 indicates no path exists between the respective
vertices. The matrix is updated iteratively to include all reachable paths.
Exp. No: 11 DEVELOP A PROGRAM TO FIND OUT THE MAXIMUM AND MINIMUM
Date: NUMBERS USING THE DIVIDE AND CONQUER TECHNIQUE
Result:
The Divide and Conquer technique efficiently finds the maximum and minimum numbers
by recursively dividing the array into smaller subarrays and comparing the results.
Exp. No: 12 IMPLEMENT MERGE SORT AND QUICK SORT METHODS TO SORT
Date: AN ARRAY OF ELEMENTS
Result:
The randomized algorithm for finding the Kth smallest number efficiently selects a pivot
and partitions the array, narrowing down the search.