stringsort 2.0.1

Pathological sorting of string characters
Documentation
  • Coverage
  • 0%
    0 out of 6 items documented0 out of 5 items with examples
  • Size
  • Source code size: 5.75 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 232.8 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • serprex/stringsort
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • serprex

Sort characters of a string (eg asdf => adfs). Exposes 3 methods, all taking an &str to return a String

vecsort: Converts arg into Vec, sorts Vec, converts Vec to String insertsort: Builds a string by employing linear insert sort on each character countsort_insert: Builds a string by counting the occurences for all ascii characters, building up a sorted string of nonascii characters with insert sort, then generates a string based off counts of ascii characters & appends nonascii countsort_vec: Similar to countsort_insert, but buffers nonascii as a vector to sort afterwards

insertsort is good for very small strings, bucketsort is good if you expect mostly ascii, vecsort is the only one that isn't worst case quadratic NB bucketsort is O(N) for ascii strings