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

Lab - Questions

The document provides 24 programming problems involving algorithms like recursive and non-recursive algorithms, Strassen's matrix multiplication, heap sort, dynamic programming, Warshall's algorithm, knapsack problem, Huffman coding, and N-queen problem using techniques like divide and conquer, transform and conquer, backtracking, branch and bound, and greedy algorithms. The problems involve sorting arrays, matrix multiplication, finding optimal coin combinations and knapsack solutions, transitive closures, constructing Huffman trees, and solving the N-queen problem.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Lab - Questions

The document provides 24 programming problems involving algorithms like recursive and non-recursive algorithms, Strassen's matrix multiplication, heap sort, dynamic programming, Warshall's algorithm, knapsack problem, Huffman coding, and N-queen problem using techniques like divide and conquer, transform and conquer, backtracking, branch and bound, and greedy algorithms. The problems involve sorting arrays, matrix multiplication, finding optimal coin combinations and knapsack solutions, transitive closures, constructing Huffman trees, and solving the N-queen problem.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Create a program for recursive and non-recursive algorithms and examine the
order of growth from log2n to n!

2. Write a program using Divide and Conquer Strassen's Matrix Multiplication to


multiply the two square matrices A and B, each of size n x n.

A=123 B=223
345 145
5 43 643

3. Create a program to sort the following elements 4,8,2,7,19,22,3,5,9 in an


ascending order using Transform and Conquer Heap Sort method.

4. Write a program to sort the following elements 8,18,10,9,20,4,3,6,5 in an


ascending order using Transform and Conquer Heap Sort method.

5. Write a program to sort the following elements 8,18,10,9,20,4,3,6,5 in an


ascending order using Transform and Conquer Heap Sort method.

6. Given coins of denominations 1, 2, 4 and 5 with amount to be bay is 8. Create


a program to find optimal number of coins and sequence of coins used to pay
the given amount using dynamic programming method.
7. Create a program to find the transitive closure of the digraph specified in the
following graph using Warshall's algorithm.

a b

c d

8. Create a program for the given instance of problem to obtain the optimal
solution for the knapsack problem using Dynamic Programming

Item Weight Value


1 2 3
2 3 4
3 4 5
4 5 6

Capacity W=5

9. Create a program using Greedy Techniques to Construct the Huffman’s Tree


& code for the following data

Character A B C D E -
Probability 0.1 0.5 0.35 0.5 0.4 0.2

10. Create a program using Greedy Techniques to Construct the Huffman’s Tree
& code for the following data

Character m n o p q r
Probability 0.5 0.1 0.4 0.3 0.2 0.5
11. Create a program for N-Queen (5 Queen) problem using Backtracking

12. Create a program to find the optimal solution using Branch and Bound method
for the following assignment problem.

Job1 Job2 Job3 Job4


Employee1 10 11 5 7
Employee2 6 8 9 5
Employee3 5 7 10 8
Employee4 7 6 8 12

13. Create a program to find the optimal solution using Branch and Bound method
for the following assignment problem.

Job1 Job2 Job3 Job4


Employee1 7 6 10 7
Employee2 12 7 9 5
Employee3 8 6 7 10
Employee4 5 11 5 12

14. Create a program for recursive and non-recursive algorithms and examine the
order of growth from log2n to n!
15. Write a program using Divide and Conquer Strassen's Matrix Multiplication to
multiply the two square matrices A and B, each of size n x n.

A=123 B=223
345 145
6 43 643

16. Create a program to sort the following elements 4,8,2,7,19,22,3,5,9 in an


ascending order using Transform and Conquer Heap Sort method.

17. Write a program to sort the following elements 8,18,10,9,20,4,3,6,5 in an


ascending order using Transform and Conquer Heap Sort method.

18. Write a program to sort the following elements 8,18,10,9,20,4,3,6,5 in an


ascending order using Transform and Conquer Heap Sort method.

19. Given coins of denominations 1, 2, 4 and 5 with amount to be bay is 8. Create


a program to find optimal number of coins and sequence of coins used to pay
the given amount using dynamic programming method.

20. Create a program to find the transitive closure of the digraph specified in the
following graph using Warshall's algorithm.

a b

c d
21. Create a program for the given instance of problem to obtain the optimal
solution for the knapsack problem using Dynamic Programming

Item Weight Value


1 2 3
2 3 4
3 4 5
4 5 6

Capacity W=5

22. Create a program using Greedy Techniques to Construct the Huffman’s Tree
& code for the following data

Character A B C D E -
Probability 0.1 0.5 0.35 0.5 0.4 0.2

23. Create a program using Greedy Techniques to Construct the Huffman’s Tree
& code for the following data

Character m n o p q r
Probability 0.5 0.1 0.4 0.3 0.2 0.5

24. Create a program for N-Queen (5 Queen) problem using Backtracking

You might also like