Thank you for your interest in contributing to this Java DSA & OOPs learning repository! 🎉
We welcome contributions from developers of all skill levels. Whether you're fixing bugs, adding new data structures/algorithms, improving documentation, or enhancing existing code, your help is appreciated!
- Code of Conduct
- How Can I Contribute?
- Getting Started
- Contribution Guidelines
- Coding Standards
- Commit Message Guidelines
- Pull Request Process
This project adheres to a code of conduct that all contributors are expected to follow:
- Be respectful and inclusive
- Use welcoming and inclusive language
- Accept constructive criticism gracefully
- Focus on what is best for the community
- Show empathy towards other community members
- Check if the bug has already been reported in Issues
- If not, create a new issue with a clear title and description
- Include steps to reproduce, expected behavior, and actual behavior
- Add relevant code snippets or screenshots if applicable
- Open an issue with the tag "enhancement"
- Clearly describe the feature and its potential benefits
- Explain why this enhancement would be useful
- Implementing new data structures or algorithms
- Adding problem solutions with detailed explanations
- Improving existing code efficiency or readability
- Writing or improving documentation
- Adding unit tests
-
Fork the Repository
# Click the 'Fork' button at the top right of the repository page -
Clone Your Fork
git clone https://github.com/YOUR-USERNAME/Java-DSA-OOPS-Complete.git cd Java-DSA-OOPS-Complete -
Create a Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make Your Changes
- Write clean, readable code
- Follow the coding standards outlined below
- Test your changes thoroughly
-
Commit Your Changes
git add . git commit -m "Your descriptive commit message"
-
Push to Your Fork
git push origin feature/your-feature-name
-
Create a Pull Request
- Go to the original repository
- Click "New Pull Request"
- Select your fork and branch
- Fill in the PR template with details
- Place files in appropriate directories
- Include comprehensive comments explaining the logic
- Add time and space complexity analysis
- Provide example usage in comments or separate examples
- Include the problem statement as a comment
- Explain the approach and algorithm used
- Add complexity analysis
- Provide multiple solutions if applicable (brute force, optimized)
- Create clear, practical examples
- Include real-world use cases
- Explain concepts with comments
- Follow OOP best practices
- Keep README.md and other docs up to date
- Use clear and concise language
- Include code examples where helpful
- Check for spelling and grammar
-
Naming Conventions
- Classes:
PascalCase(e.g.,BinarySearchTree) - Methods:
camelCase(e.g.,insertNode) - Variables:
camelCase(e.g.,currentNode) - Constants:
UPPER_SNAKE_CASE(e.g.,MAX_SIZE)
- Classes:
-
Code Structure
/** * Class description * @author Your Name */ public class ExampleClass { // Constants private static final int MAX_VALUE = 100; // Instance variables private int value; // Constructor public ExampleClass(int value) { this.value = value; } // Methods public void exampleMethod() { // Implementation } }
-
Comments
- Use JavaDoc for classes and public methods
- Add inline comments for complex logic
- Explain the "why" not just the "what"
-
Code Quality
- Keep methods focused and concise
- Avoid code duplication (DRY principle)
- Handle edge cases and exceptions
- Write self-documenting code
/**
* Binary Search implementation
* Time Complexity: O(log n)
* Space Complexity: O(1)
*
* @author Your Name
*/
public class BinarySearch {
/**
* Performs binary search on a sorted array
*
* @param arr Sorted array of integers
* @param target Element to search for
* @return Index of target element, -1 if not found
*/
public static int binarySearch(int[] arr, int target) {
int left = 0;
int right = arr.length - 1;
while (left <= right) {
int mid = left + (right - left) / 2;
if (arr[mid] == target) {
return mid;
} else if (arr[mid] < target) {
left = mid + 1;
} else {
right = mid - 1;
}
}
return -1;
}
}Write clear and meaningful commit messages:
- Use present tense ("Add feature" not "Added feature")
- Use imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters
- Reference issues and pull requests when relevant
Examples:
Add bubble sort implementation
Fix null pointer exception in LinkedList
Update README with installation instructions
Refactor BinaryTree traversal methods
-
Before Submitting
- Ensure your code compiles without errors
- Test your changes thoroughly
- Update documentation if needed
- Make sure your branch is up to date with main
-
PR Description
- Clearly describe what changes you've made
- Explain why these changes are necessary
- Reference any related issues
- Include screenshots for UI changes (if applicable)
-
Review Process
- Be patient and responsive to feedback
- Make requested changes promptly
- Engage in constructive discussion
- Once approved, your PR will be merged!
-
After Merge
- Delete your branch (optional)
- Update your fork
git checkout main git pull upstream main
If you have any questions or need help:
- Open an issue with the "question" label
- Check existing issues and discussions
- Reach out to the maintainers
Thank you for contributing to Java-DSA-OOPS-Complete! Your efforts help make this a valuable learning resource for everyone. 🚀
Happy Coding! ☕💻