double_sort 1.2.0

This is a fast and simple sorting algorithm which groups numbers into pairs and orders them onwards as nodes
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented2 out of 2 items with examples
  • Size
  • Source code size: 18.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.22 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • alexmmych/double_sort
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Shroomerian

Double Sort

This is a short and concise sorting algorithm written in Rust as a learning project.

It works by grabbing numbers from a vector in pairs of two, putting them into a structure called Nodes, comparing both numbers in it and placing the smallest one to the left and the biggest to the right. A binary heap is used to place the Nodes in ascending order, ordering by their leftmost number and then after that the program loops by checking neighbouring numbers and swapping them if needed. All of this is still on the heap so the order of the Nodes will still be consistent. The vector is always sorted after n/2 - 1 times (Rounded up for odd amounts)

Visualization (10.000 numbers)

https://user-images.githubusercontent.com/54857786/187537791-f1bb2df9-d723-4ba5-9bf8-82e73161cc18.mp4

Visualization was done with: sorting-visualization

Diagram

double_sort