pub struct AdaptiveSort { /* private fields */ }Expand description
Adaptive sorting algorithm that selects optimal strategy based on data patterns
Implementations§
Source§impl AdaptiveSort
impl AdaptiveSort
pub fn new() -> Self
Sourcepub fn detect_patterns<T: Ord>(data: &[T]) -> DataPattern
pub fn detect_patterns<T: Ord>(data: &[T]) -> DataPattern
Pattern detection finds pre-sorted regions (skip unnecessary work)
Sourcepub fn select_optimal_algorithm<T>(
data_len: usize,
pattern: DataPattern,
data_type: DataType,
) -> SortAlgorithm
pub fn select_optimal_algorithm<T>( data_len: usize, pattern: DataPattern, data_type: DataType, ) -> SortAlgorithm
Adaptive algorithm selection based on data characteristics
Sourcepub fn counting_sort(data: &mut [i32], min: i32, max: i32)
pub fn counting_sort(data: &mut [i32], min: i32, max: i32)
Counting sort for small integer ranges (O(n+k) complexity)
Sourcepub fn intern_strings(strings: Vec<String>) -> (Vec<usize>, Vec<Arc<String>>)
pub fn intern_strings(strings: Vec<String>) -> (Vec<usize>, Vec<Arc<String>>)
String interning for repeated values (reduce memory and comparisons)
Sourcepub fn cache_optimized_merge<T: Ord + Copy>(
left: &[T],
right: &[T],
output: &mut [T],
)
pub fn cache_optimized_merge<T: Ord + Copy>( left: &[T], right: &[T], output: &mut [T], )
Cache-optimized merge with prefetching
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdaptiveSort
impl RefUnwindSafe for AdaptiveSort
impl Send for AdaptiveSort
impl Sync for AdaptiveSort
impl Unpin for AdaptiveSort
impl UnwindSafe for AdaptiveSort
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more