All Projects → gustavo-depaula → Stalin Sort

gustavo-depaula / Stalin Sort

Licence: mit
Add a stalin sort algorithm in any language you like ❣️ if you like give us a ⭐️

Projects that are alternatives of or similar to Stalin Sort

Ergo
The Language for Smart Legal Contracts
Stars: ✭ 108 (-87.56%)
Mutual labels:  hacktoberfest, coq
Accumulo
Apache Accumulo
Stars: ✭ 857 (-1.27%)
Mutual labels:  hacktoberfest
Ember Cli Fastboot
Server-side rendering for Ember.js apps
Stars: ✭ 849 (-2.19%)
Mutual labels:  hacktoberfest
Pynvim
Python client and plugin host for Nvim
Stars: ✭ 851 (-1.96%)
Mutual labels:  hacktoberfest
Lozad.js
🔥 Highly performant, light ~1kb and configurable lazy loader in pure JS with no dependencies for responsive images, iframes and more
Stars: ✭ 6,932 (+698.62%)
Mutual labels:  hacktoberfest
Hott Species
Combinatorial species in HoTT
Stars: ✭ 9 (-98.96%)
Mutual labels:  coq
Laminas Code
Extensions to the PHP Reflection API, static code scanning, and code generation
Stars: ✭ 844 (-2.76%)
Mutual labels:  hacktoberfest
Coqjvm
Coq executable semantics and resource verifier
Stars: ✭ 10 (-98.85%)
Mutual labels:  coq
Hazelcast Jet
Distributed Stream and Batch Processing
Stars: ✭ 855 (-1.5%)
Mutual labels:  hacktoberfest
Cufp 2015 Tutorial
An introductory tutorial for the Coq proof assistant.
Stars: ✭ 9 (-98.96%)
Mutual labels:  coq
Vscode Debug Visualizer
An extension for VS Code that visualizes data during debugging.
Stars: ✭ 7,116 (+719.82%)
Mutual labels:  hacktoberfest
Platform
Reactive libraries for Angular
Stars: ✭ 7,020 (+708.76%)
Mutual labels:  hacktoberfest
Monads
Coq code accompanying several articles on semantics of functional programming languages
Stars: ✭ 9 (-98.96%)
Mutual labels:  coq
Kudo
Kubernetes Universal Declarative Operator (KUDO)
Stars: ✭ 849 (-2.19%)
Mutual labels:  hacktoberfest
Dblib Linear
Formalisation of the linear lambda calculus in Coq
Stars: ✭ 10 (-98.85%)
Mutual labels:  coq
Android Image Picker
Image Picker for Android 🤖
Stars: ✭ 847 (-2.42%)
Mutual labels:  hacktoberfest
Trivy
Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues
Stars: ✭ 9,673 (+1014.4%)
Mutual labels:  hacktoberfest
Conpot
ICS/SCADA honeypot
Stars: ✭ 853 (-1.73%)
Mutual labels:  hacktoberfest
Swiftyjsonaccelerator
macOS app to generate Swift 5 code for models from JSON (with Codeable)
Stars: ✭ 864 (-0.46%)
Mutual labels:  hacktoberfest
Supervisor
🏡 Home Assistant Supervisor
Stars: ✭ 862 (-0.69%)
Mutual labels:  hacktoberfest

Welcome to the Stalin Sort Repo 📋

poster

What is Stalin Sort? ❓

Introduction

Stalin Sort is an efficient sorting algorithm, serving as a systematic method for placing the elements of a random access file or an array in order. Stalin Sort is also know as the best sorting algorithm of all times because of its AMAZING capacity of always ordering an array with an O(n) performance.

How it works?

It's simple, all you need to do is iterate through the array, checking if its elements are in order. Any element that isn't in order you pull out, in other words, you send it to Gulag.

Step-by-step example

  1. (1 2 5 3 5 7) -> (1 2 5 3 5 7) Here the algorithm stores the first of element of the array
  2. (1 2 5 3 5 7) -> (1 2 5 3 5 7) Now it will compare the stored element with the second one, if this is bigger than the stored, it replaces the stored element by this
  3. (1 2 5 3 5 7) -> (1 2 5 3 5 7) Repeats step 2
  4. (1 2 5 3 5 7) -> (1 2 5 5 7) Since the 4th element is smaller than the 3rd one, the 4th element will be eliminated.
  5. (1 2 5 5 7) -> (1 2 5 5 7) Equal elements are preserved
  6. (1 2 5 5 7) Ordered array!

Pseudocode implementation

Keep in mind that this is pseudocode, and is just an example. We strongly encourage you to code a different approach.

FUNCTION stalinSort(A : list OF sortable items)
    n := length(A)
    bigger := 0
    B SET empty list

    FOR i := 0 TO n NOT inclusive DO
        IF A[i] >= bigger THEN
          bigger := A[i]
          B.push(A[i])
        END IF
    END FOR

    RETURN B
END FUNCTION

Want to help? 🙌

Please check the CONTRIBUTING.md

Give this Project a Star! ⭐️

About

Stalin sort began first as a Hacktoberfest 2018 repo

Hacktoberfest is a program organised by Digital Ocean and Github, where you can easily win a T-Shirt just by making 5 pull requests in the month of October to any open source projects on Github.

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].