DAA Lab Assignments
DAA Lab Assignments
Module I
1. Write a program in C++ to find the greatest of three numbers and also calculate the worst case
complexity.
2. In a small company there are five salesman. Each salesman is supposed to sell three products.
Write a C++ program using a 2D array to print (i) the total sales by each salesman and (ii) total
sales of each item and also calculate the worst case complexity.
3. Write a program in C++ to calculate the sum of the first 10 numbers and also calculate the worst
case complexity.
4. Write a program in C++ to sum the series 1/2 + 2/3 +..........+n/n+1 and also calculate the worst
case complexity.
5. Write a program in C++ to implement push and pop operation in a Stack and also calculate the
worst case complexity.
6. Write a program in C++ to implement Enqueue and Dequeue in a Linear Queue and also
calculate the worst case complexity.
7. Write a program in C++ to implement FIFO list and also calculate the worst case complexity.
8. Write a program in C++ to implement Fibonacci Problem and also calculate the worst case
complexity.
9. Write a program in C++ to implement Enqueue and Dequeue in a Circular Queue and also
calculate the worst case complexity.
Module II
1. Write a program in C++ to implement Binary Search using Divide-and-Conquer method and also
calculate the best case and worst case complexity.
2. Write a program in C++ to implement Heap Sort using Divide-and-Conquer method and also
calculate the best case and worst case complexity.
3. Write a program in C++ to implement Merge Sort using Divide-and-Conquer method and also
calculate the best case and worst case complexity.
4. Write a program in C++ to implement Max-Heap Sort and also calculate the best case and worst
case complexity.
5. Write a program in C++ to implement Linear Search and also calculate the best case and worst
case complexity.
6. Write a program in C++ to read a sentence until a'.' is entered and also calculate the worst case
complexity.
7. Write a program in C++ to read a line until a newline character is entered and also calculate the
worst case complexity.
8. Write a program in C++ for Insertion Sort and also calculate the best case and worst case
complexity.
9. Write a program in C++ for Selection Sort and also calculate the best case and worst case
complexity.
10. Write a program in C++ to implement Quick Sort and also calculate the best case and worst
case complexity.
11. Write a program in C++ to implement Bubble Sort and also calculate the best case and worst
case complexity.
12. Write a program in C++ to implement optimal binary search tree and also calculate the best case
and worst case complexity.
Module III
1. Write a program in C++ to implement Coin Change Problem using Greedy method and also
calculate the best case and worst case complexity.
2. Write a program in C++ to implement Fractional Knapsack Problem using Greedy method and
also calculate the best case and worst case complexity.
3. Write a program in C++ to implement Huffman Code using Greedy method and also calculate the
best case and worst case complexity.
4. Write a program in C++ to implement 0/1 Knapsack Problem using dynamic programming and
also calculate the best case and worst case complexity.
5. Write a program in C++ to implement Travelling Salesman Problem using dynamic programming
and also calculate the best case and worst case complexity.
6. Write a program in C++ to implement Bellman Ford Algorithm using dynamic programming and
also calculate the best case and worst case complexity.
Module IV
1. Write a program in C++ to implement Breadth First Search (BFS) and also calculate the best
case and worst case complexity.
.
2. Write a program in C++ to implement Depth First Search (DFS) and also calculate the best case
and worst case complexity.
3. Write a program in C++ to implement Prim's Algorithm and also calculate the best case and
worst case complexity.
4. Write a program in C++ to implement Kruskal's Algorithm and also calculate the best case and
worst case complexity.
5. Write a program in C++ to implement 4-Queen Problem using backtracking method and also
calculate the best case and worst case complexity.
6. Write a program in C++ to implement Vertex Colouring Problem and also calculate the best case
and worst case complexity.
7. Write a program in C++ to implement Hamiltonian Circuit Problem and also calculate the best
case and worst case complexity.
Note: Write the algorithm for each of the program and also the implementation.
NOTICE
This is to inform all the students of BTech 3rd and 5th Semester Computer Science & Engineering
that the laboratory exams will be held on the details given below:
Mrs.Nomi Baruah,
Asst. Prof.,Dept. of CSE,
DUIET,D.U.