1 unstable release
0.1.0 | Dec 6, 2021 |
---|
#1347 in Development tools
9KB
179 lines
SORT ALGORITHMS WITH VISUALIZER
Obs:. This just a briefing of the algorithm!!!
SELECTION SORT
Selection Sortis an algorithm that use order by selection
Worst, Medium and Best Case Complexity: O(n²)
https://en.wikipedia.org/wiki/Selection_sort
sort::selection_sort::selection_sort(arr: &mut Vec, compare: fn(T,T) -> bool)
QUICK SORT
Quick sort is an algorithm that use strategy divide to conquer
Worst Case Complexity: O(n²)
Medium Case Complexity: O(n)
Best Case Complexity: O(n log n)
https://en.wikipedia.org/wiki/Quicksort
sort::quick_sort::quick_sort(arr: &mut Vec, start: usize, end: usize, compare: fn (T, T) -> bool)
HEAP SORT
Heap sort is an generalist algorithm that use the strategy order by selecion
Worst Case Complexity: O(n log n)
Medium Case Complexity: O(n log n)
Best Case Complexity: O(n log n)
https://en.wikipedia.org/wiki/Heapsort
sort::heapsort::heapsort(arr: &mut Vec)
MERGE SORT
Merge sort is an algorithm that use the strategy order by comparation and divide to conquer
Worst Case Complexity: O(n log n)
Medium Case Complexity: O(n log n)
Best Case Complexity: O(n)
https://en.wikipedia.org/wiki/Merge_sort
sort::merge_sort::sort(arr: &mut Vec, begin: usize, end: usize, compare: fn(T, T) -> bool)
RADIX SORT
Radix sort is an algorithm that use the strategy non-comparative
Worst Case Complexity: O(n)
Medium Case Complexity: O(n)
Best Case Complexity: O(n)
https://en.wikipedia.org/wiki/Radix_sort
sort::radix_sort::radix_sort(arr: &mut Vec)