Hey there! 👋 We’re so glad you’re here and interested in contributing to this project. Below, you'll find guidelines and instructions to help you get started. Let’s dive in! 🚀
This repo is meant for your own learning — writing and debugging code yourself will help you grow as a developer.
Start by forking this repository to create a copy under your GitHub account.
- Hit the Fork button on the repository page.
Clone your forked version:
git clone https://github.com/<your-username>/DSA.git
cd DSA(Replace <your-username> with your GitHub username.)
To keep your fork up-to-date with the original repository:
git remote add upstream https://github.com/arhamgarg/DSA.gitBefore making any changes, create a new branch:
git checkout -b feat/<branch-name>Examples:
feat/add-dijkstrafix/binary-search-bug
Now you’re all set to start coding!
There’s plenty to do! Here are some ways you can help:
- New Data Structures and Algorithms: If you have a data structure or an algorithm we’re missing, bring it in!
- Bug Fixes: Fix those pesky bugs!
- Documentation: Add examples, comments, or improve the README. This helps others understand the code better.
- Different approaches and Proposing new problems: Implement a new approach to solve an existing problem in the repository. If you feel like something could be added as a problem, feel free to open an issue and put your problem request as comments.
Once your changes are ready:
-
Commit Your Work Write clear and concise commit messages:
git commit -m "add: Quick Sort implementation in Python" -
Push Your Branch Send your changes to your fork:
git push origin feat/<branch-name>
-
Open a Pull Request
- Head to the original repository.
- Click Pull Requests > New Pull Request.
- Select your branch, add a meaningful title and description, and submit the PR. Let it be short and crisp.
-
Feedback Time Reviewers might leave comments—don’t worry, it’s all to make your work shine! Update your code and resubmit when needed.
Great code is readable and consistent. Here are some tips to keep in mind:
- Document Your Code: Add comments for tricky parts.
- Follow Naming Conventions:
- Use camelCase for variables and functions.
- Use PascalCase for classes and files.
- Use kebab-case for directories.
- Test Your Code: Include test cases with inputs and expected outputs.
- Use Formatters: Automated formatters help enforce standards and keep your codebase consistent. Here are some common ones:
| Programming Language | Formatter | Command |
|---|---|---|
| C | clang-format | clang-format -i *.c |
| C++ | clang-format | clang-format -i *.cpp |
| Dart | dart format | dart format . |
| Go | gofmt | gofmt -s -w . |
| Java | google-java-format | google-java-format -i *.java |
| Python | ruff | ruff format . |
| Rust | rustfmt | cargo fmt |
| TypeScript | biome | biome check --write . |
If you have any questions or suggestions, open a discussion under the Discussions tab.
We’re happy to have you onboard. 🚀