0% found this document useful (0 votes)
1 views

LabExercises

The document outlines various tasks related to searching and sorting algorithms, including implementations of Linear Search, Binary Search, Insertion Sort, and Heap Sort, along with time analysis for different input sizes. It also details graph algorithms such as Breadth First Search, Depth First Search, Dijkstra’s algorithm, Prim’s algorithm, Floyd’s algorithm, and Warshall's algorithm. Additionally, it covers algorithm design techniques using divide and conquer, Merge sort, and Quick sort with performance evaluations.

Uploaded by

MAHESWARI M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

LabExercises

The document outlines various tasks related to searching and sorting algorithms, including implementations of Linear Search, Binary Search, Insertion Sort, and Heap Sort, along with time analysis for different input sizes. It also details graph algorithms such as Breadth First Search, Depth First Search, Dijkstra’s algorithm, Prim’s algorithm, Floyd’s algorithm, and Warshall's algorithm. Additionally, it covers algorithm design techniques using divide and conquer, Merge sort, and Quick sort with performance evaluations.

Uploaded by

MAHESWARI M
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Searching and Sorting Algorithms

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 be searched 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.
Graph Algorithms
1.Develop a program to implement graph traversal using Breadth First Search
2.Develop a program to implement graph traversal using Depth First Search
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.
5.Implement Floyd’s algorithm for the All-Pairs- Shortest-Paths problem.
6.Compute the transitive closure of a given directed graph using Warshall's algorithm.

Algorithm Design Techniques


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.

You might also like