All the programs done in Design and Analysis of Algorithms Lab in my 5th Semester.
largest.cpp
Write a program to find the largest element in a given array.evenodd.cpp
Convert an array such that all the even elements are grouped together followed by the odd elements.presum.cpp
Find the prefix sum of an array.secLargest.cpp
Find the second Largest and Smallest element in an array.dupe.cpp
Read n numbers from a file and output- The number of duplicate elements in the array.
- The most frequent element in the array.
d2b.cpp
WAP to convert the firstn
decimal numbers of a disc file to binary using recursion. Store the binary value in separate disc file.agcdb.cpp
WAP to find GCD of firstn
pairs of numbers from a file using recursion. Save the output to file.
RotateRight.cpp
WAP to shift the elements of an array to the right byk
positions.RotateLeft.cpp
WAP to shift the elements of an array to the left byk
positions.recrev.cpp
WAP to reverse an array using recursion.
merge.cpp
WAP to sort an array using Merge Sort.
quick.cpp
WAP to sort an array using Quick Sort.mul2dig.cpp
WAP to multiply two numbers using Divide and Conquer.maxsub.cpp
Find the Maximum Sum Subarray.
huff.cpp
Implement Huffman Coding for sequences:BCCABBDDAECCBBAEDDCC
122341322144344
knap.cpp
Implement Fractional Knapsack with following strategies- Non-increasing order of profit
- Non-decreasing order of weight
- Non-increasing order of profit/weight ratio
jobseq.cpp
Implement Job Sequencing Algorithm.prims.cpp
Implement Prims Algorithm to find Minimum Spanning Tree and its sum.kruskals.cpp
Implement Kruskal's Algorithm to find Minimum Spanning Tree and its sum.
dijkstra.cpp
Implement Dijkstra's Algorithm to find the shortest path from a source node to all other nodes.
binknap.cpp
Implement 0/1 Knapsack Problem using Dynamic Programming.mcm.cpp
Implement Matrix Chain Multiplication using Dynamic Programming.
floyd.cpp
Implement Floyd's Algorithm to find the shortest path between all pairs of nodes.lcs.cpp
Implement Longest Common Subsequence using Dynamic Programming.msg.cpp
Multi Stage Graph Problem.