saxbophone / tr-sort

Transpose-Sort —why sort numbers with comparisons when we can calculate their rough sort positions instead?
https://saxbophone.com/tr-sort
2 stars 0 forks source link

Wrote special test cases for arrays of size 2 #12

Closed saxbophone closed 1 year ago

saxbophone commented 1 year ago

Rationale: I believe there is a typo in the current tr-sort code, which almost optimises for these cases (since we can just check which is the biggest and which is the smallest then call it a day), but where an early return has been missed out. These additional test cases are to confirm 2-sized arrays are being correctly sorted both before correcting the typo AND after