Skip to content

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

License

Notifications You must be signed in to change notification settings

alexmmych/double_sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

Sort-Algorithm.mp4

Visualization was done with: sorting-visualization

Diagram

double_sort

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages