All Projects → OleksiyRudenko → stalin-sort

OleksiyRudenko / stalin-sort

Licence: MIT license
A repressive sorting algorithm (not really sorting)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to stalin-sort

E-Learning-freesite
This site is mainly design for those student who don't know how to start their journey in the field of programming
Stars: ✭ 57 (+338.46%)
Mutual labels:  educational-project
easyvk
This app helps you create an apps with vk api easy!
Stars: ✭ 97 (+646.15%)
Mutual labels:  npm-module
protocol-registry
This module allows you to set custom protocol handler for your nodejs app.
Stars: ✭ 45 (+246.15%)
Mutual labels:  npm-module
js-stack-from-scratch
🌺 Russian translation of "JavaScript Stack from Scratch" from the React-Theming developers https://github.com/sm-react/react-theming
Stars: ✭ 394 (+2930.77%)
Mutual labels:  npm-module
micro-signals
A tiny typed messaging system inspired by js-signals that uses ES2015 sets
Stars: ✭ 39 (+200%)
Mutual labels:  npm-module
yamlinc
Compose multiple YAML files into one with $include tag. Split Swagger/OpenAPI into multiple YAML files.
Stars: ✭ 103 (+692.31%)
Mutual labels:  npm-module
zsh-launchpad
🚀 Simple, educational dotfiles template to get started with Zsh and learn about its features
Stars: ✭ 141 (+984.62%)
Mutual labels:  educational-project
react-native-input-prompt
A cross-platform user input prompt component for React Native with Native UI.
Stars: ✭ 45 (+246.15%)
Mutual labels:  npm-module
surger
⚡ Is there surge pricing around me right now?
Stars: ✭ 20 (+53.85%)
Mutual labels:  npm-module
FA
Репозиторий практик факультета ИТиАБД направления Прикладной Информатики в Финансовом Университете при Правительстве РФ
Stars: ✭ 26 (+100%)
Mutual labels:  educational-project
intersection-wasm
Mesh-Mesh and Triangle-Triangle Intersection tests based on the algorithm by Tomas Akenine-Möller
Stars: ✭ 17 (+30.77%)
Mutual labels:  npm-module
MinifyAllCli
📦 A lightweight, simple and easy npm tool to 𝗺𝗶𝗻𝗶𝗳𝘆 JSON/C, HTML and CSS! Also known as MinifyAll core! ⭐ Usable as 𝑪𝑳𝑰 tool or 𝒊𝒎𝒑𝒐𝒓𝒕𝒂𝒃𝒍𝒆 in TS/JS as a 𝑴𝑶𝑫𝑼𝑳𝑬 🥰
Stars: ✭ 21 (+61.54%)
Mutual labels:  npm-module
framework-2021
A custom framework empowered Weather App
Stars: ✭ 27 (+107.69%)
Mutual labels:  kottans
notebooks-ci-showcase
Fully Configured Example of CI/CD For Notebooks On Top Of GCP
Stars: ✭ 22 (+69.23%)
Mutual labels:  educational-project
React-Pincode
A NPM module which auto fills City, District and State fields when a valid Zip Code in entered!
Stars: ✭ 26 (+100%)
Mutual labels:  npm-module
bettertext.css
Improved default typography for naked HTML or Markdown-generated content.
Stars: ✭ 36 (+176.92%)
Mutual labels:  npm-module
ts-ci
🚀 A starter for TS projects meant to be published on NPM.
Stars: ✭ 282 (+2069.23%)
Mutual labels:  npm-module
AutomationShield
Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering education.
Stars: ✭ 22 (+69.23%)
Mutual labels:  educational-project
windows-network-drive
Do network drive stuff on Microsoft Window in node
Stars: ✭ 18 (+38.46%)
Mutual labels:  npm-module
react-folder-tree
A versatile react treeview library that supports custom icons and event handlers
Stars: ✭ 56 (+330.77%)
Mutual labels:  npm-module

stalinSort

Inspired by a post on mastodon

Developed for educational purposes within kottans

Installation

  • npm: npm install --save @rudenko/stalin-sort
  • yarn: yarn add @rudenko/stalin-sort

Usage

const stalinSort = require('@rudenko/stalin-sort')

const numbers = [5, 2, 18, 1];
const strings = ['klm', 'nop', 'def', 'abc']
let result

try {
  result = stalinSort(numbers) // [5, 18]
} catch (e) {
  // handle exception TypeError('Argument must be an array')
}

try {
  result = stalinSort(strings, (a, b) => a > b) // ['klm', 'def', 'abc']
} catch (e) {
  // handle exceptions:
  // - TypeError('Argument must be an array')
  // - TypeError('Comparator must be a function')
}

See example.js for more examples.

Educational

Advance from version to version to track the development process.

See also CHANGELOG.md

Version Milestone Comment Diff
0.0.1 Initialize project
0.0.2 Add code stub and basic test Tests fail v0.0.1...v0.0.2
0.0.3 Add positive scenarios test set Tests still fail v0.0.2...v0.0.3
0.1.0 Add for loop implementation Tests succeed v0.0.3...v0.1.0
0.1.1 Change implementation using for...in loop Tests succeed v0.1.0...v0.1.1
0.1.2 Change implementation using for...of loop Tests succeed v0.1.1...v0.1.2
0.2.0 Change implementation using Array.forEach Tests succeed v0.1.2...v0.2.0
0.3.0 Change implementation using Array.reduce Tests succeed v0.2.0...v0.3.0
0.4.0 Change implementation using Array.filter Tests succeed v0.3.0...v0.4.0
0.4.1 Change Array.filter condition (skip boolean literals) Tests succeed v0.4.0...v0.4.1
0.4.2 Change Array.filter condition (distill logic) Tests succeed v0.4.1...v0.4.2
0.5.0 Add error handling on wrong argument type Tests succeed v0.4.2...v0.5.0
0.6.0 Add compare argument and pre-defined comparators Tests succeed v0.5.0...v0.6.0
0.7.0 Add usage and example.js Tests succeed v0.6.0...v0.7.0
0.8.0 Fix stalinSort implementation logical mistake Tests succeed v0.7.0...v0.8.0
0.8.1 Add tests for comparison functions from utils Tests succeed v0.8.0...v0.8.1

Similar projects

Misc

Time spent: apx 2hrs

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