Skip to content

A pretty fast sorting algorithm, that works on both the extremities (edges) of a list per iteration to sort the given list in either ascending or descending order.

Notifications You must be signed in to change notification settings

SHUR1K-N/SortNinja-Double-Edged-Sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SortNinja: A Double-Edged Sorting Algorithm

Description & Usage

A conceptually unique sorting algorithm, that sorts two integers per iteration (either in ascending or descending order, as per the user's selection) instead of the rather conventional/traditional one-integer-per-iteration approach, using the Python-native min() and max() functions.

Upon completion, the initial input list is destroyed and only the final sorted list prevails, which is either displayed on-screen or dumped into a new file (as per the user's selection).

Example Execution

This project was created in Python, and can be tested using my own NumNinja and/or RandomNinja tools which can help create massive numbered list files within user specified constraints, respectively either in ascending order or randomized order.

Note

In no way is this algorithm to be considered an effort to be among the explicitly faster of sorting algorithms. This is merely a unique/unorthodox algorithm in its manner of sorting cycles. Since the min() and max() functions that lie within a single SortNinja iteration themselves involve a single cycle each of scanning the entire list, this already means one iteration of SortNinja's sorting is two entire scans of the unsorted list using min() and max(). This gives SortNinja a time complexity of O(2n), which would be the same as sorting one item at a time anyway; SortNinja just sorts both extremities alternatively (hence "Double-Edged").

TL;DR: I just wanted to use the "double-edged sort" pun, so I made something to fulfill the name.

Dependencies to PIP-Install

  • colorama (for colors)
  • termcolor (for colors)

My website: https://TheComputerNoob.com

About

A pretty fast sorting algorithm, that works on both the extremities (edges) of a list per iteration to sort the given list in either ascending or descending order.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages