Skip to content

Add Radix Sort implementation in Python#226

Merged
Pradeepsingh61 merged 1 commit intomainfrom
add-python-radix-sort
Oct 1, 2025
Merged

Add Radix Sort implementation in Python#226
Pradeepsingh61 merged 1 commit intomainfrom
add-python-radix-sort

Conversation

@Karanjot786
Copy link
Copy Markdown
Collaborator

📝 Description

This PR adds a comprehensive Radix Sort algorithm implementation in Python with counting sort as a stable subroutine for
digit-wise sorting.

📂 Files Added

  • Python/algorithms/sorting/radix_sort.py

✨ Features

  • Counting sort subroutine: Stable sort for each digit position
  • Radix Sort: Non-comparison based sorting for non-negative integers
  • Copy function: Returns sorted copy without modifying original array
  • Comprehensive test cases: 7 different test scenarios including:
    • Random unsorted array
    • Already sorted array
    • Reverse sorted array
    • Array with duplicates
    • Single digit numbers
    • Large numbers with multiple digits
    • Single element array

📊 Complexity Analysis

  • Time Complexity: O(d * (n + k)) where d = number of digits, k = range of digits (0-9)
  • Space Complexity: O(n + k) for temporary arrays

🔑 Key Concepts

  • Non-comparison based sorting algorithm
  • Processes digits from least significant to most significant (LSD)
  • Uses counting sort as stable subroutine for each digit position
  • Efficient for integers with limited number of digits

✅ Testing

All test cases run successfully and demonstrate correct sorting behavior across different input scenarios including edge
cases.

🎃 Hacktoberfest 2025

This contribution is part of Hacktoberfest 2025. The code follows the repository's structure (Language/Topic/FileName) and
includes proper documentation.

📋 Checklist

  • Code follows repository structure (Python/algorithms/sorting/)
  • Proper documentation and comments added
  • Test cases included
  • Time and space complexity documented
  • No user input required (tests run automatically)
  • Code is well-formatted and readable

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🎉 Welcome to Hacktoberfest 2025, @Karanjot786! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

@Pradeepsingh61 Pradeepsingh61 merged commit 07e30c8 into main Oct 1, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants