pub struct MaxSubArraySum { /* private fields */ }
Expand description
Implementation of the solution to the maximum subarray problem. It just implements Node
.
Trait Implementations§
Source§impl Clone for MaxSubArraySum
impl Clone for MaxSubArraySum
Source§fn clone(&self) -> MaxSubArraySum
fn clone(&self) -> MaxSubArraySum
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MaxSubArraySum
impl Debug for MaxSubArraySum
Source§impl Default for MaxSubArraySum
impl Default for MaxSubArraySum
Source§fn default() -> MaxSubArraySum
fn default() -> MaxSubArraySum
Returns the “default value” for a type. Read more
Source§impl Node for MaxSubArraySum
impl Node for MaxSubArraySum
Source§type Value = i64
type Value = i64
This type corresponds to the type of the information to create the node with
Node::initialize
.Source§fn initialize(value: &Self::Value) -> Self
fn initialize(value: &Self::Value) -> Self
Function to create nodes from saved value, it is assumed that even if there’s more data saved in the node,
value
should have enough data to create all of the data of a node of a segment segment of exactly one element.Source§fn combine(a: &Self, b: &Self) -> Self
fn combine(a: &Self, b: &Self) -> Self
Function which will combine nodes
a
and b
, where each corresponds to segments [i,j]
and [j+1,k]
respectively, into a node which corresponds to the segment [i,k]
. This function must be associative (taking * as a symbol for combine, we have that a*(b*c)==(a*b)*c is true), but need not be commutative (it’s not necessarily true that a*b==b*a).Source§impl PartialEq for MaxSubArraySum
impl PartialEq for MaxSubArraySum
impl Eq for MaxSubArraySum
impl StructuralPartialEq for MaxSubArraySum
Auto Trait Implementations§
impl Freeze for MaxSubArraySum
impl RefUnwindSafe for MaxSubArraySum
impl Send for MaxSubArraySum
impl Sync for MaxSubArraySum
impl Unpin for MaxSubArraySum
impl UnwindSafe for MaxSubArraySum
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