Prem-Kumar-Dev / hacktoberfest2024-project

Welcome to the Hacktoberfest 2024 beginner coding problems repository! This project is designed for those who want to contribute to open-source while solving basic coding challenges. Whether you are a first-time contributor or looking to practice programming, you're in the right place.
MIT License
8 stars 77 forks source link

Wrote shell sort code in java #54

Closed DhruvTotala closed 1 month ago

DhruvTotala commented 1 month ago

Shell Sort is an optimized version of Insertion Sort. It starts by sorting elements far apart using a gap and then reduces the gap incrementally. In each iteration, it performs a gapped insertion sort where elements are compared and shifted across the gap. This improves performance for large datasets. In the provided code, the gap starts as half the array length and is repeatedly halved. The elements are shifted to their correct positions as the gap decreases, leading to a partially sorted array that is finally fully sorted.

DhruvTotala commented 1 month ago

@Prem-Kumar-Dev please review my code and suggest necessary changes.