2021-04-24 23:56:27 +00:00
[![.NET ](https://github.com/MakeContributions/DSA/actions/workflows/dotnet.yml/badge.svg )](https://github.com/MakeContributions/DSA/actions/workflows/dotnet.yml)
[![C++ ](https://github.com/MakeContributions/DSA/actions/workflows/cpp.yml/badge.svg )](https://github.com/MakeContributions/DSA/actions/workflows/cpp.yml)
[![Go ](https://github.com/MakeContributions/DSA/actions/workflows/go.yml/badge.svg )](https://github.com/MakeContributions/DSA/actions/workflows/go.yml)
[![Node.js CI ](https://github.com/MakeContributions/DSA/actions/workflows/node.js.yml/badge.svg )](https://github.com/MakeContributions/DSA/actions/workflows/node.js.yml)
[![Python ](https://github.com/MakeContributions/DSA/actions/workflows/python.yml/badge.svg )](https://github.com/MakeContributions/DSA/actions/workflows/python.yml)
[![codespell ](https://github.com/MakeContributions/DSA/actions/workflows/codespell.yml/badge.svg )](https://github.com/MakeContributions/DSA/actions/workflows/codespell.yml)
2021-04-24 23:59:57 +00:00
[![CodeQL ](https://github.com/MakeContributions/DSA/actions/workflows/codeql-analysis.yml/badge.svg )](https://github.com/MakeContributions/DSA/actions/workflows/codeql-analysis.yml)
2021-07-17 20:59:51 +00:00
[![Discord ](https://img.shields.io/discord/863049619734790185?color=7389D8&logo=discord&logoColor=ffffff&label=&labelColor=6A7EC2 )](https://discord.gg/ydWxdqbTyK)
2021-07-09 13:38:09 +00:00
2020-12-17 03:18:20 +00:00
# Data Structures and Algorithm
2021-04-14 18:38:49 +00:00
2021-01-15 13:52:11 +00:00
Data structure and Algorithm (DSA)
2021-04-18 21:18:04 +00:00
## Explanations
2022-08-10 21:16:42 +00:00
2021-04-18 21:18:04 +00:00
- [English ](./docs/en )
2022-08-10 21:16:42 +00:00
- [Español ](./docs/es )
2022-02-07 15:10:32 +00:00
- [Português ](./docs/pt )
- [Turkish ](./docs/tr )
2021-05-08 12:54:07 +00:00
- [繁體中文 ](./docs/zh-tw )
2021-08-09 12:59:32 +00:00
- [日本語 ](./docs/ja )
2021-04-18 21:18:04 +00:00
2021-01-15 13:52:11 +00:00
## Contribution Guidelines
2021-03-18 19:48:09 +00:00
2021-04-07 18:32:02 +00:00
### 1. Contribution Specifications
2021-03-18 19:48:09 +00:00
2021-04-18 14:40:26 +00:00
The problem being contributed must either be a simple **file** (**Eg.** [`kruskal-algorithm.cpp` ](./algorithms/CPlusPlus/Graphs/kruskal-algorithm.cpp ), [`linear-search.java` ](./algorithms/Java/searching/linear-search.java )) or a more complex **directory** ([`palindrome/`](./algorithms/Rust/strings/palindrome)). This is a unit `problem` .
2021-03-18 19:48:09 +00:00
2021-04-20 12:29:02 +00:00
The directory tree has the following convention of `algorithms/{language}/{category}/{problem}` , where `{language}` represents the language code of the problem (**Eg.** `CPlusPlus` for C++, `CSharp` for C# etc.), `{category}` is the topic or category of the problem being contributed (**Eg.** `strings` , `sorting` , `linked-lists` etc.), and `{problem}` is a conforming name to the problem (**Eg.** `linear-search.cpp` , `palindrome` , `queue-linked-list.cpp` etc.)
2021-03-18 19:48:09 +00:00
A unit `problem` must conform to the following specifications:
2021-04-14 18:38:49 +00:00
2021-03-18 19:48:09 +00:00
- The name should be in lowercase. (**Eg.** `palindrome/` , `binary-search.cpp` etc.).
2021-04-10 09:10:32 +00:00
- Each word must be separated by a **dash** or a **hyphen** (`-`).
2021-03-18 19:48:09 +00:00
2021-04-14 18:38:49 +00:00
**If you have a problem that belongs to a new _topic_ or _category_ than one which are present:**
2021-03-18 19:48:09 +00:00
1. Create a new folder and an index for it inside (a readme, `README.md` file).
2. To each new index file, write the readme with your `problem` in it ([Markdown Documentation](https://guides.github.com/features/mastering-markdown/)).
3. The folder name can also only contain **lowercase characters** and **dashes** or **hyphens** (`-`) (Eg. `strings` `sorting` etc.)
2021-04-07 18:32:02 +00:00
#### Simple (File) Contributions
2021-03-18 19:48:09 +00:00
The file should conform to the `problem` specification, and the extension (**Eg.** `linear-search.java` , `kruskal-algorithm.cpp` , `count-inversions.js` etc.)
2021-04-07 18:32:02 +00:00
#### Project/Folder-based Contributions
2021-03-18 19:48:09 +00:00
2022-10-06 00:16:14 +00:00
The project and folder-based contributions have a bit more stricter contribution specifications.
2021-03-18 19:48:09 +00:00
The folder should conform to the `problem` specification, along with the following specifications
**Folder Structure**
2021-04-14 18:38:49 +00:00
2021-03-18 19:48:09 +00:00
```bash
problem-name\
| - .gitignore
| - README.md
| - Makefile # or the specific specification/requirements/configuration file
| - src\
| - main.ext
```
2021-04-07 18:32:02 +00:00
#### `README.md` Specification / Template
2021-03-18 19:48:09 +00:00
2021-04-14 18:38:49 +00:00
````markdown
2021-03-18 19:48:09 +00:00
# <Title of the Problem>
< description of the problem >
## Prerequisites
- prerequisite library or package
- [prerequisite library ](https://www.example.com/link-to-official-library )
## Instructions
- instructions to run the project
- < Simple and reproducible commands to execute the project >
2021-04-14 18:38:49 +00:00
```bash
make # or 'cargo run', or 'dotnet run' or 'mvn exec:java' etc.
```
2021-03-18 19:48:09 +00:00
## Test Cases & Output < if exists>
< If you can provide test cases , describe it here , else remove this section >
2021-04-14 18:38:49 +00:00
````
2021-04-07 18:32:02 +00:00
#### `.gitignore` File
2021-04-14 18:38:49 +00:00
2021-03-18 19:48:09 +00:00
```gitignore
# add all output files and build files to be excluded from git tracking
main # executable file also must have the project name
target/ # the build file, for example for rust
2021-01-15 13:52:11 +00:00
```
2021-03-18 19:48:09 +00:00
2021-04-07 18:32:02 +00:00
#### Build File / Specification File / Configuration File
2021-04-14 18:38:49 +00:00
2021-03-18 19:48:09 +00:00
It can be any of the following ones
2021-04-14 18:38:49 +00:00
2021-03-18 19:48:09 +00:00
- **C/C++**: `Makefile`
- **Python**: `requirements.txt`
- **JavaScript**: `package.json` and `package-lock.json`
- **Rust**: `Cargo.toml` and `Cargo.lock`
- **Go**: `go.mod`
2021-04-07 18:32:02 +00:00
#### Source Code File
2021-03-18 19:48:09 +00:00
2022-11-30 12:56:18 +00:00
The source code files should either be in `src/` folder (**Eg.** `src/main.cpp` or `src/main.js` ) or the root folder (**Eg.** `palindrome.go` or `App.java` ) where `ext` is the file extension for the specific programming language.
2021-03-18 19:48:09 +00:00
Again, the source codes must conform to a valid file structure convention that the programming language enforces.
2021-04-07 18:32:02 +00:00
### 2. Naming Convention
2021-03-18 19:48:09 +00:00
The programming should keep the naming convention rule of each programming language.
2020-12-23 14:22:49 +00:00
2021-01-29 14:53:10 +00:00
### Other topic
2021-04-14 18:38:49 +00:00
2021-01-29 14:53:10 +00:00
- [First-time contribution ](CONTRIBUTING.md )
2021-03-03 22:52:16 +00:00
2021-05-21 12:17:36 +00:00
## Reviewers
2021-04-14 18:38:49 +00:00
2022-08-30 23:38:25 +00:00
| Programming Language | Users |
| -------------------- | ----------------------------------------------------------- |
| C or C++ | @Arsenic -ATG, @UG -SEP, @aayushjain7 , @Ashborn -SM, @Ashad001 |
2022-09-11 19:42:18 +00:00
| Java | @TawfikYasser , @aayushjain7 , @mohitchakraverty |
2022-08-30 23:38:25 +00:00
| C# | @ming -tsai, @Waqar -107 |
| Go | @ayo -ajayi |
| Python | @Arsenic -ATG, @sridhar -5 |
| JavaScript | @ming -tsai |
2021-04-14 18:38:49 +00:00
2021-05-21 12:17:36 +00:00
## Contributors
< a href = "https://github.com/MakeContributions/DSA/graphs/contributors" >
< img src = "https://contrib.rocks/image?repo=MakeContributions/DSA" / >
< / a >
2021-04-09 16:48:38 +00:00
## Open Graph
2021-04-14 18:38:49 +00:00
2021-04-09 16:48:38 +00:00
< img src = "https://opengraph.github.com/3b128f0e88464a82a37f2daefd7d594c6f41a3c22b3bf94c0c030135039b5dd7/MakeContributions/DSA" / >
2020-12-23 14:22:49 +00:00
## License
2021-04-14 18:38:49 +00:00
2020-12-23 14:22:49 +00:00
[MIT ](./LICENSE )