Skip to content

โšก Comprehensive collection of Design & Analysis of Algorithms ๐Ÿš€ | Includes ๐Ÿงฎ Sorting, ๐Ÿ’ก Dynamic Programming, ๐ŸŽฏ Greedy, ๐ŸŒ Graph, and ๐Ÿ”ค String Matching | Implemented in โš™๏ธ C++ with STL | Perfect for ๐ŸŽ“ students & ๐Ÿ‘จโ€๐Ÿ’ป developers exploring algorithmic problem-solving โœจ

License

Notifications You must be signed in to change notification settings

H0NEYP0T-466/DAA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

DAA - Design and Analysis of Algorithms ๐Ÿš€

GitHub License GitHub Stars GitHub Forks Contributions Welcome GitHub Issues

A comprehensive collection of Design and Analysis of Algorithms implementations in C++. This repository contains efficient implementations of fundamental algorithms across various categories including sorting, dynamic programming, greedy algorithms, graph algorithms, and string matching techniques.


๐Ÿ”— Links


๐Ÿ“š Table of Contents


๐Ÿ“ฆ Installation

Prerequisites

  • C++ Compiler (GCC 7.0+ or Clang 6.0+ or MSVC 2017+)
  • Standard Template Library (STL) support
  • Make (optional, for build automation)

Steps

  1. Clone the repository

    git clone https://github.com/H0NEYP0T-466/DAA.git
    cd DAA
  2. Compile any algorithm

    # Example: Compile Shell Sort
    g++ -o shell_sort Shell_sort.cpp
    
    # Example: Compile Dynamic Programming algorithms
    g++ -o knapsack Dynamic_progrmaing/01Knapsack_dp_bottom_up.cpp
    
    # Example: Compile Greedy algorithms
    g++ -o huffman greedy_algorithms/huffman_coding.cpp
  3. Run the executable

    ./shell_sort
    ./knapsack
    ./huffman

๐Ÿš€ Usage

Command Line Interface

Each algorithm can be compiled and executed independently:

# Sorting Algorithms
g++ -o bucket_sort Bucket_sort.cpp && ./bucket_sort
g++ -o counting_sort Counting_Sort.cpp && ./counting_sort
g++ -o radix_sort Radix_sort.cpp && ./radix_sort

# Dynamic Programming
g++ -o lcs Dynamic_progrmaing/lcs_dp_bottom_up.cpp && ./lcs
g++ -o mcm Dynamic_progrmaing/mcm_dp_bottom_up.cpp && ./mcm

# Greedy Algorithms
g++ -o kruskal greedy_algorithms/kruskal's_algorithm.cpp && ./kruskal
g++ -o fractional_knapsack greedy_algorithms/fractional_knapsack.cpp && ./fractional_knapsack

# String Matching
g++ -o kmp "string_matching(knutt_morris_pratt(kmp) algo ).cpp" && ./kmp
g++ -o rabin_karp "string_matching(rabin_carp Algorithm).cpp" && ./rabin_karp

Example Usage

// Example: Using Shell Sort
#include "Shell_sort.cpp"

int main() {
    int arr[] = {64, 34, 25, 12, 22, 11, 90};
    int n = sizeof(arr)/sizeof(arr[0]);
    
    shellSort(arr, n);
    printArray(arr, n);
    
    return 0;
}

โœจ Features

๐Ÿ”ข Sorting Algorithms

  • Shell Sort - Improved insertion sort with gap sequence
  • Bucket Sort - Distribution-based sorting for uniformly distributed data
  • Counting Sort - Linear time sorting for integers within a range
  • Radix Sort - Non-comparative sorting algorithm

๐Ÿ’ก Dynamic Programming

  • 0/1 Knapsack Problem - Multiple implementations (brute force, top-down, bottom-up)
  • Longest Common Subsequence (LCS) - String similarity algorithms
  • Matrix Chain Multiplication - Optimal parenthesization problem
  • Fibonacci Series - Various DP approaches with space optimization

๐ŸŽฏ Greedy Algorithms

  • Huffman Coding - Optimal data compression
  • Kruskal's Algorithm - Minimum Spanning Tree with Disjoint Set Union
  • Fractional Knapsack - Greedy optimization problem
  • Activity Selection - Meeting scheduling problem

๐ŸŒ Graph Algorithms

  • Floyd-Warshall Algorithm - All-pairs shortest path
  • Topological Sort - Both DFS and BFS (Kahn's) implementations
  • Single Source Shortest Path - Using topological sort in DAG

๐Ÿ”ค String Matching

  • Knuth-Morris-Pratt (KMP) - Linear time pattern matching
  • Rabin-Karp Algorithm - Rolling hash-based matching
  • Naive Approach - Brute force string matching

โšก Additional Features

  • Kirchoff's Theorem - Circuit analysis implementation
  • Optimized implementations with detailed comments
  • Multiple algorithm variants for comparison
  • Memory-efficient solutions where applicable

๐Ÿ“ Project Structure

DAA/
โ”œโ”€โ”€ ๐Ÿ“„ README.md
โ”œโ”€โ”€ ๐Ÿ“„ LICENSE
โ”œโ”€โ”€ ๐Ÿ“„ CONTRIBUTING.md
โ”œโ”€โ”€ ๐Ÿ”ง .git/
โ”œโ”€โ”€ 
โ”œโ”€โ”€ ๐Ÿ“Š Sorting Algorithms
โ”‚   โ”œโ”€โ”€ Shell_sort.cpp
โ”‚   โ”œโ”€โ”€ Bucket_sort.cpp
โ”‚   โ”œโ”€โ”€ Counting_Sort.cpp
โ”‚   โ””โ”€โ”€ Radix_sort.cpp
โ”œโ”€โ”€ 
โ”œโ”€โ”€ ๐Ÿ“ Dynamic_progrmaing/
โ”‚   โ”œโ”€โ”€ 01Knapsack_brute_forse.cpp
โ”‚   โ”œโ”€โ”€ 01Knapsack_dp_bottom_up.cpp
โ”‚   โ”œโ”€โ”€ 01Knapsack_dp_top_down.cpp
โ”‚   โ”œโ”€โ”€ fibonacci_series.cpp
โ”‚   โ”œโ”€โ”€ finding nth number in fibonaci series using dp(bottom up)+space_optimization.cpp
โ”‚   โ”œโ”€โ”€ finding nth number in fibonaci series using dp(bottom up).cpp
โ”‚   โ”œโ”€โ”€ finding nth number in fibonaci series using dp(top down).cpp
โ”‚   โ”œโ”€โ”€ finding nth number in fibonaci series.cpp
โ”‚   โ”œโ”€โ”€ lcs_dp_bottom_up.cpp
โ”‚   โ”œโ”€โ”€ lcs_dp_top-down.cpp
โ”‚   โ”œโ”€โ”€ mcm_brute_forse.cpp
โ”‚   โ”œโ”€โ”€ mcm_dp_bottom_up.cpp
โ”‚   โ”œโ”€โ”€ mcm_dp_top_down.cpp
โ”‚   โ””โ”€โ”€ simple_lcs.cpp
โ”œโ”€โ”€ 
โ”œโ”€โ”€ ๐Ÿ“ greedy_algorithms/
โ”‚   โ”œโ”€โ”€ candy_shop _problem.cpp
โ”‚   โ”œโ”€โ”€ fractional_knapsack.cpp
โ”‚   โ”œโ”€โ”€ huffman_coding.cpp
โ”‚   โ”œโ”€โ”€ kruskal's_algorithm.cpp
โ”‚   โ”œโ”€โ”€ n number of meetings in a room.cpp
โ”‚   โ””โ”€โ”€ reverse_string.cpp
โ”œโ”€โ”€ 
โ”œโ”€โ”€ ๐ŸŒ Graph Algorithms
โ”‚   โ”œโ”€โ”€ Floyd_Warshall Algorithm_APSP.cpp
โ”‚   โ”œโ”€โ”€ single_source_shortestPath_using topological_sort in DAG.cpp
โ”‚   โ”œโ”€โ”€ topological_sort(bfs) kahn's algorithm.cpp
โ”‚   โ””โ”€โ”€ topological_sort(dfs).cpp
โ”œโ”€โ”€ 
โ”œโ”€โ”€ ๐Ÿ”ค String Matching Algorithms
โ”‚   โ”œโ”€โ”€ string_matching(knutt_morris_pratt(kmp) algo ).cpp
โ”‚   โ”œโ”€โ”€ string_matching(naive approch).cpp
โ”‚   โ””โ”€โ”€ string_matching(rabin_carp Algorithm).cpp
โ””โ”€โ”€ 
โ””โ”€โ”€ โšก Additional Algorithms
    โ””โ”€โ”€ Kirchoff's therom.cpp

๐Ÿ› ๏ธ Built With

๐Ÿ’ป Languages

C++

๐Ÿ“š Libraries & Frameworks

STL

๐Ÿ—„๏ธ Data Structures

Vector Queue Priority Queue String

๐Ÿ”ง Tools

GCC Git GitHub

๐Ÿงฎ Algorithms & Techniques

Dynamic Programming Greedy Algorithms Graph Algorithms Sorting Algorithms String Algorithms


๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details on:

  • ๐Ÿด How to fork and contribute
  • ๐Ÿ“ Code style and linting rules
  • ๐Ÿ› Bug reports and feature requests
  • ๐Ÿงช Testing and documentation updates

Quick Start for Contributors

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ—บ๏ธ Roadmap

โœ… Current Features

  • Sorting Algorithms - Shell, Bucket, Counting, Radix sort implementations
  • Dynamic Programming - Knapsack, LCS, MCM, Fibonacci variants
  • Greedy Algorithms - Huffman coding, MST, fractional knapsack
  • Graph Algorithms - Floyd-Warshall, topological sort, shortest paths
  • String Matching - KMP, Rabin-Karp, naive approaches

๐Ÿ”„ Planned Features

  • Advanced Graph Algorithms
    • Dijkstra's shortest path algorithm
    • Bellman-Ford algorithm
    • Prim's algorithm for MST
    • Strongly connected components (Tarjan's/Kosaraju's)
  • Advanced Dynamic Programming
    • Edit distance (Levenshtein distance)
    • Optimal Binary Search Tree
    • Traveling Salesman Problem (TSP)
  • Machine Learning Algorithms
    • K-Means clustering
    • Linear regression
    • Decision trees
  • Numerical Algorithms
    • Fast Fourier Transform (FFT)
    • Matrix operations and decompositions
    • Root finding algorithms

๐Ÿš€ Future Vision

  • Interactive Visualizations - Web-based algorithm visualization tools
  • Performance Benchmarks - Comprehensive time/space complexity analysis
  • Python Implementations - Parallel implementations in Python
  • Documentation Website - Detailed algorithm explanations with complexity analysis
  • Unit Testing Framework - Comprehensive test coverage for all algorithms
  • API Development - RESTful API for algorithm execution and analysis

๐Ÿ™ Acknowledgements

๐ŸŽ“ Educational Resources

  • Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein (CLRS)
  • Algorithm Design by Jon Kleinberg and ร‰va Tardos
  • Competitive Programming communities and online judges

๐Ÿ› ๏ธ Tech Stack & Libraries

  • C++ Standard Template Library (STL) for efficient data structures
  • GNU Compiler Collection (GCC) for compilation
  • Git & GitHub for version control and collaboration

๐ŸŒŸ Inspiration

Special thanks to the open-source community and algorithm enthusiasts who contribute to making computer science education accessible to everyone.


Made with โค๏ธ by H0NEYP0T-466

About

โšก Comprehensive collection of Design & Analysis of Algorithms ๐Ÿš€ | Includes ๐Ÿงฎ Sorting, ๐Ÿ’ก Dynamic Programming, ๐ŸŽฏ Greedy, ๐ŸŒ Graph, and ๐Ÿ”ค String Matching | Implemented in โš™๏ธ C++ with STL | Perfect for ๐ŸŽ“ students & ๐Ÿ‘จโ€๐Ÿ’ป developers exploring algorithmic problem-solving โœจ

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages