Almost there! Just a few clicks from the resource you need.

You can either checkout with the notes in your basket now, or find more notes. The choice is yours!

My Basket

My Basket

Design and Analysis of Algorithms LAB programs Part 1

Q1. Write a C program that will read an array of elements and display the following: i> Duplicate elements present in the array with their frequency ii> The duplicate element with highest frequency of occurrence Example : Input: 1 2 1 3 4 3 4 3 Output: 1 is duplicate with 2 frequency 3 having the highest frequency Q 2. Write a C program that will read an array arr of elements in sorted manner and display the elements at i,j,k index such that arr[i] + arr[j] + arr[k] = key, where key element is given as input. Q 3. Write a C program that will generate random numbers within a value and store the values in an array. Display the second maximum in the array as output. Input: 12, 3, 27, 9,6 Output: 12 Q4. Write a C program WAP that will produce random numbers in any range and store it in a matrix. Convert it to a tri-diagonal matrix and display the new matrix as output. 00 01 02 03 10 11 12 13 20 21 22 23 30 31 32 33 Convert remaining elements as non zero and other elements as zero. Q 5. Write a C program that will read an array consist of positive and negative numbers. Rearrange the numbers in such a way that all positive numbers will be separated from all negative numbers and display it as output. Input : 1,-2,-4,3,6,-9,2 Output: -2,-4,-9,1,3,6,2

£62.50 Preview Remove