## Insertion Sort

Sort a given unsorted array using the insertion sort algorithm. Input: {9,5,1,6,11,8,4} Output: {1,4,5,6,8,9,11} Theory Insertion Sort sorts numbers in the same way as we humans sort a set of numbered objects (ex cards) A number is taken from an unsorted array (right subarray) to a position in the sorted …

## Quick Sort

Quick Sort is a sorting algorithm. Given an unsorted array sort it using quick sort algorithm. Example Input: {8, 9, 5, 2, 3, 1, 4} Output: {1, 2, 3, 4, 5, 8, 9} Theory It’s a Divide and Conquer sorting Algorithm. It picks a pivot element in the array, splits …

## Subset sum problem

In the subset sum problem, we are given a list of all positive numbers and a Sum. We need to check if there is a subset whose sum is equal to the given sum. Example Input List of numbers: 1 2 3 10 5 sum: 9 Output  true Explanation  for …

## Heap Sort

Heap sort is a comparison based sorting technique that is based on a Binary Heap data structure. HeapSort is similar to a selection sort where we find the maximum element and then place that element at the end. We repeat this same process for the remaining elements. Given an unsorted …

## Coin Change Problem

Coin Change Problem – Given some coins of different values c1, c2, … , cs (For instance: 1,4,7….). We need an amount n. Use these given coins to form the amount n. You can use a coin as many times as required. Find the total number of ways in which …

## Subtraction of Two Matrices

Problem Statement In the “Subtraction of Two Matrices” problem, we have given two matrices a and b. We have to find the final matrix after subtracting matrix b from matrix a. If the order is the same for both the matrices then only we can subtract them otherwise we can’t. …

## Check if Two given Matrices are Identical

Problem Statement Given two matrices, we will write a function to check whether the two matrices are identical or not. That is, if all the elements in the respective positions of the two matrices are the same, then we say that they are identical. Input Format The first line containing …