All Projects → JamesQuintero → ShiftSort

JamesQuintero / ShiftSort

Licence: MIT license
Sorting algorithm quicker than MergeSort, and is adaptive and stable.

Programming Languages

C++
36643 projects - #6 most used programming language
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to ShiftSort

Algods
Implementation of Algorithms and Data Structures, Problems and Solutions
Stars: ✭ 3,295 (+8348.72%)
Mutual labels:  mergesort, sort, sorting-algorithms
Javascript
A repository for All algorithms implemented in Javascript (for educational purposes only)
Stars: ✭ 16,117 (+41225.64%)
Mutual labels:  sort, sorting-algorithms
Algorithms Primer
A consolidated collection of resources for you to learn and understand algorithms and data structures easily.
Stars: ✭ 381 (+876.92%)
Mutual labels:  sort, sorting-algorithms
Interview Questions
List of all the Interview questions practiced from online resources and books
Stars: ✭ 187 (+379.49%)
Mutual labels:  sort, sorting-algorithms
Sorting-Algorithms
sorting algorithms in python
Stars: ✭ 15 (-61.54%)
Mutual labels:  sort, sorting-algorithms
Algorithms
Short explanations and implementations of different algorithms in multiple languages
Stars: ✭ 37 (-5.13%)
Mutual labels:  sort, sorting-algorithms
Pretty Algorithms
🌊 Pretty, common and useful algorithms with modern JS and beautiful tests
Stars: ✭ 2,163 (+5446.15%)
Mutual labels:  sort, sorting-algorithms
Java
All Algorithms implemented in Java
Stars: ✭ 42,893 (+109882.05%)
Mutual labels:  sort, sorting-algorithms
stablesort
Stable sort algorithms and their stability proofs in Coq
Stars: ✭ 19 (-51.28%)
Mutual labels:  mergesort, sorting-algorithms
PixelGlitch
Image glitch visualization using various Pixel Sorting methods for Processing
Stars: ✭ 25 (-35.9%)
Mutual labels:  mergesort, sort
lua sort
Lua pure sort algorithm based on lib_table.c (from LuaJIT 2.1.0)
Stars: ✭ 21 (-46.15%)
Mutual labels:  sort, sorting-algorithms
ultra-sort
DSL for SIMD Sorting on AVX2 & AVX512
Stars: ✭ 29 (-25.64%)
Mutual labels:  sort, sorting-algorithms
Data-Structures-and-Algorithms
Implementation of various Data Structures and algorithms - Linked List, Stacks, Queues, Binary Search Tree, AVL tree,Red Black Trees, Trie, Graph Algorithms, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Segment Trees etc.
Stars: ✭ 144 (+269.23%)
Mutual labels:  sorting-algorithms, sorting-algorithms-implemented
data-structure-and-algorithm
Basic data structures, sorting algorithms, algorithms learning tools. 基本数据结构,排序算法,算法学习工具
Stars: ✭ 86 (+120.51%)
Mutual labels:  sort, sorting-algorithms
SortingLab.jl
Faster sorting algorithms (sort and sortperm) for Julia
Stars: ✭ 20 (-48.72%)
Mutual labels:  sort, sorting-algorithms
Sorting-Visualizer
📊 Sorting.Visualizer is a web app for visualizing a bunch of different sorting algorithms Like Selection Sort, Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, Heap Sort With the functionality of (Speed Control) and (Array Size Control)...
Stars: ✭ 37 (-5.13%)
Mutual labels:  sorting-algorithms, sorting-algorithms-implemented
algorithms
The All ▲lgorithms documentation website.
Stars: ✭ 114 (+192.31%)
Mutual labels:  sort, sorting-algorithms
AlgorithmVisualizer
A better visualization of different algorithms made with React
Stars: ✭ 123 (+215.38%)
Mutual labels:  sorting-algorithms
algocasts-sorting-algorithms
AlgoCasts 排序算法专题
Stars: ✭ 27 (-30.77%)
Mutual labels:  sorting-algorithms
SortVis
https://airtucha.github.io/SortVis
Stars: ✭ 23 (-41.03%)
Mutual labels:  sort

ShiftSort

Codacy Badge

Preview

ShiftSort is a stable, adaptive, divide-and-conquer sorting algorithm. When the list is already partily sorted, Shiftsort beats any other sorting algorithm.

It’s similar to Merge Sort, but is more selective on what it merges. Merge Sort splits its array in half continuously until reaching its base case of 2 elements, swaps if needed, and then merges as it returns. Shift Sort uses a derivative array to split in half continuously until reaching a base case of 2 or 3 elements, uses the results to determine what parts of the array to merge, and then merges as it returns.

Shift Sort time and space complexities:

Complexity BigO
Best O(n)
Average O(nlogn)
Worst O(nlogn)
Space n

Shift Sort has a best-case time complexity of O(n) because it uses a secondary list, and if the secondary list is empty, the array is already sorted and the algorithm stops after n iterations. Shift Sort’s O(n) beats Merge Sort’s O(nlogn). Shift Sort’s average-case complexity is the same as Merge Sort’s, but in real world testing, Shift Sort out performs Merge Sort. For space, at worst, Shift Sort will initialize a second and third list of about n/2, putting the total at n.

Main parts of Shift Sort:

  1. Derivative List Creation
  2. Splitting of Derivative list
  3. Merging Sublists

See ShiftSort-Analysis.pdf for step-by-step on Shift Sort's inner workings

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].