pub struct LinearSearch;
Expand description
To check if the list contains a node, iterate over all the nodes in the list until we find the target one. O(1) space but O(n) time.
Trait Implementations§
Source§impl Default for LinearSearch
impl Default for LinearSearch
Source§fn default() -> LinearSearch
fn default() -> LinearSearch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LinearSearch
impl RefUnwindSafe for LinearSearch
impl Send for LinearSearch
impl Sync for LinearSearch
impl Unpin for LinearSearch
impl UnwindSafe for LinearSearch
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