pub struct Markers {
pub pivot: Option<usize>,
pub heap_boundary: Option<usize>,
pub merge_runs: Vec<(usize, usize)>,
pub cursors: Vec<usize>,
pub gap: Option<usize>,
}
Expand description
Visual markers for algorithm-specific operations
Fields§
§pivot: Option<usize>
Current pivot index (Quick Sort)
heap_boundary: Option<usize>
Heap/sorted boundary (Heap Sort)
merge_runs: Vec<(usize, usize)>
Active merge regions (Merge Sort)
cursors: Vec<usize>
Current comparison positions
gap: Option<usize>
Current gap size (Shell Sort)
Implementations§
Source§impl Markers
Helper functions for working with visual markers
impl Markers
Helper functions for working with visual markers
Sourcepub fn clear_pivot(&mut self)
pub fn clear_pivot(&mut self)
Clear pivot marker
Sourcepub fn set_heap_boundary(&mut self, boundary: usize)
pub fn set_heap_boundary(&mut self, boundary: usize)
Set heap boundary for Heap Sort
Sourcepub fn clear_heap_boundary(&mut self)
pub fn clear_heap_boundary(&mut self)
Clear heap boundary
Sourcepub fn add_merge_run(&mut self, start: usize, end: usize)
pub fn add_merge_run(&mut self, start: usize, end: usize)
Add a merge run for Merge Sort
Sourcepub fn clear_merge_runs(&mut self)
pub fn clear_merge_runs(&mut self)
Clear all merge runs
Sourcepub fn set_cursors(&mut self, positions: Vec<usize>)
pub fn set_cursors(&mut self, positions: Vec<usize>)
Set cursor positions
Sourcepub fn add_cursor(&mut self, position: usize)
pub fn add_cursor(&mut self, position: usize)
Add a cursor position
Sourcepub fn clear_cursors(&mut self)
pub fn clear_cursors(&mut self)
Clear all cursors
Sourcepub fn has_active_markers(&self) -> bool
pub fn has_active_markers(&self) -> bool
Check if any markers are active
Sourcepub fn get_all_positions(&self) -> Vec<usize>
pub fn get_all_positions(&self) -> Vec<usize>
Get all active marker positions as a flat vector
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Markers
impl RefUnwindSafe for Markers
impl Send for Markers
impl Sync for Markers
impl Unpin for Markers
impl UnwindSafe for Markers
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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