An open API service indexing awesome lists of open source software.

https://github.com/tkanx/cpp-algorithms

CppAlgorithms is a comprehensive collection of C++ implementations for a wide range of algorithms, including solutions to problems from platforms like LeetCode, USACO, and more. This repository serves as a valuable resource for understanding and mastering algorithmic concepts, with well-organized code examples.
https://github.com/tkanx/cpp-algorithms

algorithms algorithms-and-data-structures cpp

Last synced: 9 months ago
JSON representation

CppAlgorithms is a comprehensive collection of C++ implementations for a wide range of algorithms, including solutions to problems from platforms like LeetCode, USACO, and more. This repository serves as a valuable resource for understanding and mastering algorithmic concepts, with well-organized code examples.

Awesome Lists containing this project

README

          

# CppAlgorithms

**CppAlgorithms** is a comprehensive collection of C++ implementations for various fundamental and advanced algorithms. This repository is designed to serve as a valuable resource for students, educators, and developers looking to deepen their understanding of algorithmic concepts through well-organized code examples and detailed explanations.

## Table of Contents

- [Introduction](#introduction)
- [Directory Structure](#directory-structure)
- [Algorithms Covered](#algorithms-covered)
- [How to Use](#how-to-use)
- [Contributing](#contributing)
- [License](#license)

## Introduction

This repository provides a wide range of algorithms implemented in C++. Each algorithm is organized by category, and every implementation is accompanied by a corresponding Markdown file explaining the algorithm in detail. Whether you're preparing for coding interviews, academic exams, or just want to improve your algorithmic skills, this repository is an excellent starting point.

## Directory Structure

```markdown
CppAlgorithms/
├── sorting/
├── searching/
├── data_structures/
├── recursion_divide_conquer/
├── dynamic_programming/
├── greedy/
├── graph_algorithms/
├── string_algorithms/
├── math/
├── geometry/
├── union_find/
└── advanced_data_structures/
```

> **Note:** Each folder contains C++ implementations of the algorithms within that category, along with Markdown files providing explanations.

## Algorithms Covered

### Sorting Algorithms

- Bubble Sort ([Explanation](sorting/bubble_sort.md))
- Selection Sort ([Explanation](sorting/selection_sort.md))
- Insertion Sort ([Explanation](sorting/insertion_sort.md))
- Merge Sort ([Explanation](sorting/merge_sort.md))
- Quick Sort ([Explanation](sorting/quick_sort.md))
- Heap Sort ([Explanation](sorting/heap_sort.md))
- Shell Sort ([Explanation](sorting/shell_sort.md))
- Counting Sort ([Explanation](sorting/counting_sort.md))
- Radix Sort ([Explanation](sorting/radix_sort.md))
- Bucket Sort ([Explanation](sorting/bucket_sort.md))

## How to Use

**Clone the Repository**:

```bash
git clone https://github.com/yourusername/CppAlgorithms.git
cd CppAlgorithms
```

**Navigate to the Algorithm Category**:

```bash
cd sorting
```

**Compile and Run the C++ File**:

```bash
g++ bubble_sort.cpp -o bubble_sort
./bubble_sort
```

**Read the Markdown File**:

Each algorithm's explanation is available in the corresponding Markdown file (`*.md`). These files contain a detailed explanation of the algorithm, including its complexity, use cases, and code walkthrough.

## Contributing

Contributions are welcome! If you'd like to contribute to this repository, please follow these steps:

1. Fork this repository.
2. Create a new branch (`git checkout -b new-branch`).
3. Make your changes.
4. Commit your changes (`git commit -am 'Add new algorithm'`).
5. Push to the branch (`git push origin new-branch`).
6. Create a new Pull Request.

## License

This repository is licensed under the MIT License. See `LICENSE` for more information.