English | 简体中文
First off, thank you for considering contributing to the Data Structure Project! It's people like you that make the open source community such a great place.
- Code of Conduct
- How Can I Contribute?
- Development Process
- Code Standards
- Commit Message Guidelines
- Pull Request Process
This project adopts the open source community code of conduct. By participating, you are expected to uphold this code. Please treat every contributor with kindness and respect.
Finding bugs is a contribution! If you find an issue, please:
- Check if the bug has been reported - Search existing Issues
- Create a detailed bug report including:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
- Environment info (OS, compiler version, etc.)
Bug Report Template:
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
Describe what you expected to happen.
**Screenshots**
If applicable, add screenshots.
**Environment:**
- OS: [e.g. Windows 10]
- Compiler: [e.g. gcc 9.3.0]
- Version: [e.g. commit hash]We welcome new ideas! Please submit feature requests via Issues:
- Clear feature description - What is this feature?
- Use case - Why is this feature needed?
- Possible implementation - How do you think it should work?
- Alternatives - Have you considered other solutions?
Want to submit code? Awesome! Please follow these steps:
# Fork the project to your GitHub account
# Then clone locally
git clone https://github.com/your-username/DataStructure.git
cd DataStructure# Create a new branch from the latest main
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-to-fix- Write clean, maintainable code
- Add necessary comments
- Update related documentation
- Add tests (if applicable)
git add .
git commit -m "feat: add new feature"git push origin feature/your-feature-nameCreate a PR on GitHub and fill out the PR template
Documentation is equally important! You can:
- Fix typos or grammar errors
- Improve code examples
- Add more explanations
- Translate documentation
DataStructure/
├── dsc/ # HTML animations
├── dsc-code/ # C implementations
│ ├── include/ # Header files
│ ├── src/ # Source code
│ └── tests/ # Test files
└── docs/ # Documentation
# Build the code
cd dsc-code
make all
# Run tests
make test
# Clean build files
make clean-
Naming Conventions
- Functions:
camelCaseorsnake_case(be consistent) - Constants:
UPPER_SNAKE_CASE - Structs:
PascalCase
- Functions:
-
Formatting
- Indentation: 4 spaces
- Max line length: 80 characters
- Braces: K&R style
-
Comments
/* Multi-line comments * for function descriptions */ // Single-line comments for inline explanations
-
Example Code
/** * Create a new node * @param value The node value * @return Pointer to the new node */ Node* createNode(int value) { Node* newNode = (Node*)malloc(sizeof(Node)); if (newNode == NULL) { fprintf(stderr, "Memory allocation failed\n"); return NULL; } newNode->data = value; newNode->next = NULL; return newNode; }
- Use semantic HTML5 tags
- Follow BEM naming convention for CSS
- Ensure smooth animations (60fps)
Follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentation updatestyle: Code formatting (no functional changes)refactor: Code refactoringtest: Adding testschore: Changes to build process or tools
Example:
feat(linkedlist): add reverse linked list function
Implemented reverseList() function for in-place reversal of singly linked list.
Time complexity O(n), space complexity O(1).
Closes #123
-
PR Checklist
- Code passes all tests
- Follows code standards
- Documentation updated
- Clear commit messages
- Complete PR description
-
PR Template
## Description Brief description of the changes in this PR ## Type of Change - [ ] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Documentation update ## Testing Describe how you tested these changes ## Screenshots (if applicable) Add screenshots to help explain changes ## Related Issues Closes #(issue number)
-
Review Process
- Requires at least 1 maintainer approval
- All CI checks must pass
- Address all review comments
- Discuss before coding - For major changes, open an issue first
- Keep it simple - One PR should do one thing
- Write tests - New features need tests
- Be patient - Maintainers may need time to review
- Bilibili: @Frank
- GitHub Issues: Project Issues
Thank you again for your contribution! 🎉