This repository contains a collection of algorithm implementations in C and C++ to solve various computational problems. These implementations are designed to aid learning, practice, and quick reference for fundamental algorithms.
- Bubble Sort: Bubble Sort Implementation (C)
- Insertion Sort: Insertion Sort Implementation (C)
- Merge Sort: Merge Sort Implementation (C)
- Selection Sort: Selection Sort Implementation (C)
- Binary Search: Binary Search Implementation (C++)
- Linear Search: Linear Search Implementation (C)
- Knapsack Problem: Knapsack Implementation (C)
- Longest Common Subsequence (LCS): LCS Implementation (C++)
- Longest Increasing Subsequence (LIS): LIS Implementation (C++)
- Longest Decreasing Subsequence (LDS): LDS Implementation (C++)
- Coin Change Problem: Coin Change (Greedy) Implementation (C++)
-
Clone the repository:
git clone https://github.com/mahfuzur-mafu/Algorithms.git
-
Navigate to the directory:
cd Algorithms
-
Compile and run the desired file. For example:
gcc Bubble\ Sort.c -o BubbleSort ./BubbleSort
For C++ files:
g++ Binary\ Search.cpp -o BinarySearch ./BinarySearch
Contributions are welcome! If you'd like to add a new algorithm or improve the existing ones:
- Fork the repository.
- Create a feature branch:
git checkout -b add-algorithm
- Commit your changes:
git commit -m "Added [algorithm_name] implementation"
- Push to the branch:
git push origin add-algorithm
- Submit a Pull Request.