DAA-Lab

Lab 1:

Q1. Write a c program to generate 1000 random numbers.
Q2. Write a c program for bubble sort.
Q3. Write a c program for selection sort.
Q4. Write a c program for maximum sum of two numbers in an array.

Lab 2:

Q1. Write a program to compare the time of execution of linear search and binary search.
Q2. Write a program to add n number of Matrices, n will be user input n >= 3.
Q3. Write a program to add two large integer without using long datatype.

Lab 3:

Q1. Find the GCD and LCM of n numbers where (n>=2).
Q2. Write a program to find the total number of subset and proper subset of n element also specify the elements of subsets (n >8).
Q3. Find the sum of a contiguous subarray within a 1 – D array of positive numbers which has the largest sum.
Q4. Find the sum of a contiguous subarray within a 1 – D array of numbers () which has the largest sum.

Lab 4:

Q1. Write a program to find minimum and maximum using divide and conquer methods.
Q2. Write a program to find the classical adjoint of a square matrix using recursion.
Q3. For a given array find the largest palindrome subarray.

Lab 5:

Q1. write a program for merge sort (ascending order), plot the graph
a) using a series of random number (500, 1000, 5000, 10000)
b) using a series of ascending order (500, 1000, 5000, 10000)
c) using a series of descending order (500, 1000, 5000, 10000).
Q2. Write a program for merge insertion sort where threshold = 16.

Lab 6:

Q1. Write a program to Count the number of ways we can parenthesize the expression so that the value of expression evaluates to 1. Symbols are 0 and 1, Operators are logical AND(&) and OR(|).
Q2. Write a program to implement fractional knapsack problem.
Q3. Write a program to implement activity selection problem.

Lab 7:

Q1. Write a program to implement Huffman Coding for any given string.
Q2. Given a list of tasks with deadlines and total profit earned on completing a task, find the maximum profit earned by executing the tasks within the specified deadlines.

Lab 8:

Q1. WAP to multiply two numbers using recursion (using addition operator).
Q2. WAP to print multiplication table of any number (n) using recursion.
Q3. WAP to implement Matrix Chain Multiplication using dynamic program must show the calculation table.