Added cyclic sort in C++#375
Conversation
💎 Code Quality Check Results❌ Missing Complexity AnalysisThese files don't include time/space complexity:
Required: Add comments explaining time and space complexity (e.g., ❌ Missing Algorithm DescriptionThese files don't explain what the algorithm does:
Required: Add a description explaining the algorithm, its purpose, and how it works
|
|
🎉 Welcome to Hacktoberfest 2025, @Kartikay-Mehrotra! 🎃 Thank you for your first contribution to our DSA repository! Here's what happens next: 🔍 Automatic Checks
📋 Next Steps🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon. 🎁 What You Get
💡 Tips for Success
Welcome to the community! 🚀 |
🤖 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! This comment was generated automatically. Checks will re-run when you push new commits. |
This PR adds an implementation of the Cyclic Sort algorithm in C++.
Cyclic Sort is an efficient algorithm that sorts an array of numbers from 1 to n in O(n) time and O(1) space.
It repeatedly places each element at its correct index using swaps until the array is sorted.
This implementation also includes a safe version that checks for out-of-range values.
Added cyclic_sort.cpp
Implemented Cyclic Sort with proper handling of edge cases.