Algorithms lab |
All the given programs work under linux / unix. With little modifications, these programs can be run under tc++.
1 (a) Binary search ; find the time complexity.
1 (b) Prims algorithm for undirected graph
2 (a) Linear search ; find the time complexity.
2 (b) Kruskal's algorithm for undirected graph
3 (a) Merge sort.
3 (b) Minmax.
4 (a) Warshall's algorithm to check the connectivity of a given graph.
4 (b) Traveling salesperson using Branch and Bound.
5 (a) Knapsack using greedy method.
5 (b) Breadth first search.
6 (a) Knapsack using dynamic programming.
6 (b) Quick sort.
7 (a) Job scheduling( with deadlines ) using greedy method.
7 (b) Depth first search.
8 (a) All pairs shortest path using dynamic programming.
8 (b) N-Queen's problem using backtracking.
9 (a) Traveling salesperson using Dynamic programming.
9 (b) Selection sort using Hoare's method.
10 (a) Single source shortest path ( Dijkstra's algorithm ) .
10 (b) Topological sorting.
Compiling.
$ c++ <filename.cpp>
$ ./a.out