DAA Practice Programs

Note some of these programs are self-written and not validated by a faculty member. Although these programs are correct and should work in practical exams, please use it at your own RISK!!!!!

-Shelton Coutinho

Index

  1. Write a program to sort a list of N elements using Selection Sort Technique.
  2. Write a program to perform Traveling Sales man Problem.
  3. Write program to implement Dynamic Programming algorithm for the 0/1 Knapsack problem.
  4. Write program to implement the DFS and BFS algorithm for a graph.
  5. Write a program to find minimum and maximum value in an array using divide and conquer.
  6. Write a test program to implement Divide and Conquer Strategy. Eg: Quick sort algorithm for sorting list of integers in ascending order.
  7. Write a program to implement Merge sort algorithm for sorting a list of integers in ascending order.
  8. Write C program that accepts the vertices and edges for a graph and stores it as an adjacency matrix.
  9. Implement function to print In-Degree,Out-Degree and to display that adjacency matrix.
  10. Write a program to perform Knapsack Problem using Greedy Solution.
  11. Write program to implement backtracking algorithm for solving problems like N queens.
  12. Write a program to implement the backtracking algorithm for the sum of subsets problem.
  13. Write program to implement greedy algorithm for job sequencing with deadlines.
  14. Write program to implement Dynamic Programming algorithm for the Optimal Binary Search Tree Problem.
  15. Write a program that implements Prim’s algorithm to generate minimum cost spanning Tree.
  16. Write a program that implements Kruskal’s algorithm to generate minimum cost spanning tree.

IMPORTANT!!! Add clrscr() (After intializing variables) and getch() (at the last part of the main()) to every program if you are using turbo C(legacy IDE).

Shelton Coutinho

Programs

1. Write a program to sort a list of N elements using Selection Sort Technique.

2. Write a program to perform Traveling Sales man Problem.

3. Write program to implement Dynamic Programming algorithm for the 0/1 Knapsack problem.

5. Write a program to find minimum and maximum value in an array using divide and conquer.

6. Write a test program to implement Divide and Conquer Strategy. Eg: Quick sort algorithm for sorting list of integers in ascending order.

7. Write a program to implement Merge sort algorithm for sorting a list of integers in ascending order.

8. Write C program that accepts the vertices and edges for a graph and stores it as an adjacency matrix.

9. Implement function to print In-Degree,Out-Degree and to display that adjacency matrix.

11. Write program to implement backtracking algorithm for solving problems like N queens.

12. Write a program to implement the backtracking algorithm for the sum of subsets problem.

13. Write program to implement greedy algorithm for job sequencing with deadlines.

14. Write program to implement Dynamic Programming algorithm for the Optimal Binary Search Tree Problem.

15. Write a program that implements Prim’s algorithm to generate minimum cost spanning Tree.

16. Write a program that implements Kruskal’s algorithm to generate minimum cost spanning tree.

Shelton Coutinho
Shelton Coutinho
Articles: 13

Leave a Reply

Your email address will not be published. Required fields are marked *