Hey coders and learners, We are very much pleased to have you onboard with our journey.
Steps to contribute your code in any of the mentioned dsa folder:
- Star ⭐ the repository.
- Fork the repository into your github account.
- Clone the repository into your local system by using git clone command OR edit it online on github website.
- Make a new Branch with the command
git checkout -b new_branch_name
and make changes in that branch only. - Write necessary code in your preferred folder, Add that topic in the parent folder's .md file (Example : If I've done code of Linear Search in Searching Folder, Add Linear Search under Searching Algorithm section in
Searching.md
file). - Always use Coding Style when writing a code.
- Commit the code with a meaningful description.
- Push the code to your cloned repository on your github account.
- Submit a Pull Request with your updated repository into our repository.
- That's all! You've done your Open Source Contribution. Just wait for us to merge your code into main repository.
We are thankful to all the people showing interest in our repository.
Follow this coding Scheme throughout your contribution:
-
File naming: If you are demonstrating
linear search
insearching
, name your fileLinear_Search.md
and save it in theSearching
directory. Remember to name your file in Pascal Case (First letter capital) with_
in between. Ex:Merge_Sort.md
. -
In every .md file, You need to have a Description, the code, and the time complexities.
-
Add Opening braces for loops, conditional statements,etc. on the same line.
int main()
{
// ❌
}
int main(){
// ✔️.
}
-
Indentation : Use only one indenting format for the whole program. Use 1 Tab or 4 Spaces.
-
Add appropriate comments wherever necessary to explain the code.
Programs wth NO Comments at all will not be merged.
- Expression should be readable, Use 1 space between different tokens.
a=a+b // ❌
a = a + b // ✔️.
- Always add braces in a for/while loop, even if it's a one-liner loop.
for (int i = 0; i < 10 ; i++)
cout << i << " "; // ❌
for (int i = 0; i < 10; i++){
cout << i << " "; // ✔️.
}
-
You MUST use
using namespace std;
at beginning so that you don't have to writestd::
every time (Moreover some coders also don't know how to usestd::
, so it will be easy to understand). -
MUST use
#include <bits/stdc++.h>
as competitive coders use that only (If you were unaware about it, This header file load all other header files so you don't have to include them seperately). -
Don't include
.exe
files or any other files than.cpp
(It's totally OK if you are going to contribute through Git as .gitignore file will ignore .exe files when pushing the code).