|BucketSort|HeapSort|InsertionSort|radixSort| #446
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
InsertionSort: Added the InsertionSort class with a method to perform the insertion sort on an array of integers.
Main Method: Included a main method to demonstrate the usage of the insertion sort algorithm with a sample input array.
Efforts:
Algorithm Implementation: Implemented the insertion sort algorithm by iterating through the array, comparing each element with those before it, and shifting elements to their correct positions.
Code Comments: Added comments to explain each step of the insertion sort process for better readability and understanding.
Testing: Created a sample input array and tested the sorting algorithm to ensure it works correctly and efficiently.
Impact:
Performance: Insertion sort has an average time complexity of O(n^2) and is efficient for small datasets or nearly sorted arrays.
Use Cases: Suitable for educational purposes and scenarios where insertion sort's simplicity and efficiency on small data are beneficial.
Radix Sort
Title: Implement Radix Sort Algorithm in Java
Description: This pull request introduces the implementation of the Radix Sort algorithm in Java. Radix Sort is a non-comparative sorting algorithm that sorts numbers by processing individual digits. Implemented methods to handle digit extraction and sorting by each digit position. Added comprehensive comments for clarity and tested the algorithm with various datasets to ensure accuracy.
Bucket Sort
Title: Implement Bucket Sort Algorithm in Java
Description: This pull request includes the implementation of the Bucket Sort algorithm in Java. Bucket Sort distributes elements into buckets and then sorts each bucket individually. Implemented the bucketing logic and sorting within buckets using insertion sort. Included detailed comments to explain the process and tested the algorithm with diverse datasets for validation.