Skip to content

proneutrino/Algorithms

Repository files navigation

Algorithms

DAA Assignments at IIITA

Assignment 1:

Take a 10 x 10 matrix (n x n in general) filled with Devnagri alphabets. Trace the longest sorted partition:- a) in each column of the matrix b) Trace the longest sorted child of the matrix

Assignment 2:

Write an efficient algorithm for the following purpose. For a given value of n (n>3), generate an (n x n) matrix whose cells are filled with randomly generated digits 0,.., 9. Now, scan the matrix with a (3 x 3) mask and find out those masks (mask positions) which contain all the digits 1,2,..,9 in some order. Note that, you can report a mask position by only mentioning the top-left position of the mask. Do the necessary experimentation and analysis with your algorithm..

Assignment 3:

Write an efficient algorithm to sort a given list of numbers using insertion sort. Trace the content of every location of the array in this process. Also, track the movement of every element in the list while sorting. Do the necessary experimentation and analysis with your algorithm.

Assignment 4:

Given a set of numbers, write an efficient algorithm, using Heap Sort, to report both the largest & the smallest elements of the Heap. Trace the movement of every element of the Heap during the execution of your algorithm.

Assignment 5:

Write an efficient algorithm to merge two given large Heaps of different sizes to create one large Heap. Do this merging using Heap Insertion approach where you insert elements of one Heap, one-by-one, into the other Heap. Trace the movement of elements in every step of the execution of your algorithm.

Assignment 6:

Given a large set of unsorted integers, find the maximum and minimum element using divide and conquer approach.

Assignment 7:

For some set of integers I, define f(I) as the number of pairs a,b in I such that a) a is strictly less than b b) a divides b without a remainder. Write an algorithm to find a subset I of {1,2,⋯,n} such that f(I)=k given the value of n and k

Releases

No releases published

Packages

No packages published