Skip to content

Latest commit

 

History

History
165 lines (126 loc) · 6.6 KB

File metadata and controls

165 lines (126 loc) · 6.6 KB

Contributing to AlgoDocHub

Welcome Contributors!

Thank you for your interest in contributing to AlgoDocHub. Your contributions help us enhance this valuable resource for mastering algorithms and data structures.

Getting Started

  1. Fork the Repository:

  2. Clone Your Fork:

    • Open a terminal window.
    • Use git clone git@github.com:codingdud/AlgoDocHub.git to clone your forked repository locally.
  3. Navigate to the Directory:

    • Use cd AlgoDocHub to navigate to the project's root directory.
  4. Create a Branch:

    • Use git checkout -b <your-branch-name> to create a new branch for your changes.
    • Use descriptive branch names (e.g., algorithms/bitmanipulation/add-cp-questions, bugfix/fix-array-typo).
  5. rebase

    • git stash
    • git switch main
    • git pull
    • git checkout -b foo || git switch foo
    • git rebase main
    • git pop

    use rebae for local branch only

Branch Naming Conventions for Contributors

Here's a common branch naming convention for contributors in Git projects, tailored for data structure and algorithmic contributions:

  • Prefix:
    • Use a prefix to indicate the type of change. Common prefixes include:
      • add/: For adding new features or algorithms.
      • fix/: For bug fixes.
      • update/: For updates to existing features or documentation.
      • solve/: For solving specific issues.
      • chore/: For changes that improve the development workflow but don't directly add features (e.g., documentation updates, dependency updates).
      • test/: For adding or modifying tests.
  • Description:
    • Briefly describe the change in a clear and concise way. Use kebab-case (lowercase words separated by hyphens).
  • Issue reference (optional):
    • If the branch relates to a specific issue in a tracking system (e.g., GitHub Issues), include the issue number after a hyphen (-).

Example:

add: cp-question for bitManipulation added [add #16]             // Adds bubble sort algorithm
fix/bst-insertion [#69]              // Fixes insertion logic in BST implementation
update/documentation-readme[#12]    // Updates README with new instructions
solve/issue-45-linked-list-bug [#45] // Solves issue #45 related to linked list bug
chore/update-dev-dependencies   // Updates development dependencies
test/improve-unit-tests         // Improves unit test coverage

Example for a Specific Issue

Let's say you're working on an issue reported on GitHub (#45) where the linked list implementation has a bug. Your branch name would follow the format:

solve/issue-45-linked-list-bug

Example Commit Message

A good commit message should be clear, concise, and informative. Here's a common format:

  • Verb in imperative mood: Start the message with a verb in the imperative mood (e.g., fix, add, remove).
  • Brief description: Briefly describe the change made.
  • Issue reference (optional): Include a reference to the related issue number in brackets (e.g., [Fixes #45]).
  • Additional details (optional): You can add additional details about the change if necessary.

Example:

fix: Correct linked list insertion logic [Fixes #45]

Development Guidelines

  • Code Style: Adhere to consistent coding style throughout the project. Consider using a linter or code formatter specific to C++.
  • Testing: Write unit tests for your changes using a testing framework like Google Test or Catch2 to ensure code quality and prevent regressions.
  • Documentation: Update relevant documentation (README.md, algorithm explanations, etc.) to reflect new features or bug fixes.
  • Commit Messages: Craft clear and concise commit messages that describe your changes. Utilize a format like "feat: Add bubble sort algorithm" or "fix: Resolve linked list bug".
  • Type Safety (Optional): Ensure your C++ code adheres to best practices for type safety and memory management.

Contributing Methods

  1. Bug Fixes and Improvements:

    • Search open issues for bugs or areas that need improvement.
    • Comment on relevant issues to discuss potential solutions.
    • Create a pull request (PR) with your fix or changes.
  2. New Features:

    • Discuss new feature ideas with maintainers through issues or pull requests.
    • Ensure your feature aligns with the project's goals and scope.
    • Implement the feature in a separate branch, adhering to development guidelines.

Pull Request Process

  1. Push Your Changes:

    • Commit your changes with meaningful messages using git commit -m "<your-message> [#<issue no>]".
    • Push your branch to your forked repository using git push origin <your-branch-name> [#issue no].
  2. Create a Pull Request:

    • Go to your forked repository on GitHub.
    • Navigate to your branch.
    • Click "Pull request" to create a PR.
  3. Address Feedback:

    • Respond to any comments or questions from maintainers promptly.
    • Make necessary adjustments based on feedback.

Code of Conduct

  • We value respectful and inclusive communication.
  • Please adhere to the project's code of conduct (if one exists).
  • Maintain a collaborative and professional tone in interactions.

Additional Tips

  • Break down complex changes into smaller, focused PRs for easier review.
  • Feel free to ask questions or seek clarification during the contribution process.
  • We appreciate your contributions!

Issue Structure

AlgoDocHub organizes issues in a tree structure under a main issue topic, which is broken down into sub-issues. For example:

Main Issue Topic:
- Sub-Issue: Beginner DSA
  - Sub-Issue: Arrays
  - Sub-Issue: Basic Mathematics
  - Sub-Issue: Searching
  - Sub-Issue: Sorting
  - Sub-Issue: Strings
- Sub-Issue: Data Structures
  - Sub-Issue: Binary Search Trees (BST)
  - Sub-Issue: Heaps
  - Sub-Issue: Linked Lists
  - Sub-Issue: Matrices
  - Sub-Issue: Stacks and Queues
  - Sub-Issue: Trees
- Sub-Issue: Algorithms
  - Sub-Issue: BinarySearch
  - Sub-Issue: BitManipulation
  - Sub-Issue: DynamicProgramming
  - Sub-Issue: Greedy
  - Sub-Issue: NumberTheory
  - Sub-Issue: PrefixSum
  - Sub-Issue: SortingArrayString
  - Sub-Issue: TwoPointer

When working on an issue, please refer to the specific sub-issue for detailed information and requirements.

Thank you for your interest in making AlgoDocHub an exceptional resource for mastering algorithms and data structures!


This CONTRIBUTING.md guide is designed to help contributors understand how to effectively contribute to the AlgoDocHub project, ensuring a smooth and efficient contribution process.