First version of algocol
. Available in this version:
- Bubble Sort
- Selection Sort
- Custom Error and Result types
- Utils for operating on slices and types which can be
Ord
ered.
Add reexports for algocol
.
Added
- Insertion Sort
- Merge Sort
- Binary Search
- Functions to resolve
Ordering
into booleans depending on whether they are less than, less than or equal to, equal to, greater than or equal to, or greater than.
Add re-exports for algorithms with explanations on the affixes used by the new re-exported names.
Some functions in this crate have been re-exported with shortened names
with useful classification affixes in the format <prefix>_<name>_<suffixes>
.
For example, algocol::sort::mergesort_recursively_by
is re-exported as
s_merge_rf
. The s
prefix means that this function sorts a sequence
such as a slice. merge
is the algorithm that the function uses to sort
the slice. rf
is actually a compound suffix. r
means that the function
is recursive and f
means that a function must be provided as an
argument for a task used by our mergesort function, in this case, the
input function is called compare
and returns the std::cmp::Ordering
between 2 elements.
Below are the prefixes currently used by this crate as of version 0.2.1:
s
: For functions which sort slicessc
: Functions which search for an element in a sequencesl
: Utility functions on slices
The following suffix parts are used in this crate as of version 0.2.1:
i
: This function is iterative (as opposed to recursive)r
: This function is recursivef
: This function requires an auxiliary function
- Added
timsort
. - Fixed
mergesort_recursive
andmergesort_recursively_by
.
-
Added
quicksort
and its associatedpartition
function. -
Modified
algocol::alreadysorted
to return anOk($value)
if the sequence is already sorted using this syntax:alreadysorted!(result length, return something);
The
result
at the start tells the macro that if the length of the slice is 1 or less, returnOk(something)
. -
Use bitshift left instead of multiply to marginally improve performance.
- Add structs for representing graphs, nodes and edges.
- Add automatic traits in
algocol::traits
. These automatically implemented traits are not to be confused with the traits defined using theauto trait
syntax in nightly Rust.