Design and Analysis of Algorithms

This repository contains implementations of algorithms in C++.

Algorithms

  1. Greedy Algorithms
    1. Fractional Knapsack Problem
    2. Hufman Coding for lossless data compression
  2. Divide and Conquer
    1. Maximum Sum Subarray Problem
    2. Karatsu Algorithm for Matrix Multiplication
  3. Dynamic Programming
    1. Assembly Line Scheduling
    2. 0/1 Knapsack Problem
    3. Matrix Chain Multiplication
    4. Longest Common Subsequence
  4. Backtracking
    1. N-Queens Problem
    2. Subset Sum Problem
    3. M - Graph Coloring
  5. String Matching Algorithms
    1. Naive String Matching
    2. Rabin-Karp String Matching
    3. Knuth Morris Pratt String Matching (KMP)
  6. Graph Algorithms
    1. Bellman Ford Algorithm
    2. Edmond Karp Algorithm
  7. Randomized Algorithms
    1. Randomized Quick Sort
    2. Randomized Hiring Problem
  8. Geometric Algorithms
    1. Jarvis March
    2. Check if 2 lines segments intersect

Usage

  1. Clone the repository
  2. Compile the code using g++ <filename>.cpp
  3. Run the executable using ./a.out