pub fn sort_by<T, F>(array: &mut [T], compare: F)
where
    T: std::cmp::Ord,
    F: Fn(&T, &T) -> std::cmp::Ordering,
{
    _cocktail_shaker_sort_impl(array, compare)
}
/// It takes a comparator function to determine the order,
/// and sorts it using a cocktail shaker sort algorithm.
///
/// ```rust
/// use buldak::cocktail_shaker;
///
/// let mut nums = [1, 4, 2, 3, 5, 111, 234, 21, 13];
/// cocktail_shaker::sort_by(&mut nums, |l, r| l.cmp(r));
/// assert_eq!(nums, [1, 2, 3, 4, 5, 13, 21, 111, 234]);
/// ```
It takes a comparator function to determine the order,
and sorts it using a cocktail shaker sort algorithm.




It takes a comparator function to determine the order and sorts it using a cocktail shaker sort algorithm .
pub fn sort_by<T, F>(array: &mut [T], compare: F)
where
    T: std::cmp::Ord,
    F: Fn(&T, &T) -> std::cmp::Ordering,
{
    _cocktail_shaker_sort_impl(array, compare)
}
pub fn sort_by < T , F > ( array : & mut [ T ] , compare : F ) where T : std :: cmp :: Ord , F : Fn ( & T , & T ) -> std :: cmp :: Ordering , { _cocktail_shaker_sort_impl ( array , compare ) }
It takes a comparator function to determine the order,
and sorts it using a cocktail shaker sort algorithm.
It takes a comparator function to determine the order and sorts it using a cocktail shaker sort algorithm .
array
&mut [T]
compare
F
array
&mut [T]
compare
F