Struct seg_tree::utils::MaxSubArraySum
source · [−]pub struct MaxSubArraySum { /* private fields */ }
Expand description
Implementation of the solution to the maximum subarray problem. It just implements Node.
Trait Implementations
sourceimpl Clone for MaxSubArraySum
impl Clone for MaxSubArraySum
sourcefn clone(&self) -> MaxSubArraySum
fn clone(&self) -> MaxSubArraySum
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MaxSubArraySum
impl Debug for MaxSubArraySum
sourceimpl Default for MaxSubArraySum
impl Default for MaxSubArraySum
sourcefn default() -> MaxSubArraySum
fn default() -> MaxSubArraySum
Returns the “default value” for a type. Read more
sourceimpl Node for MaxSubArraySum
impl Node for MaxSubArraySum
type Value = i64
type Value = i64
This type corresponds to the type of the information to create the node with Node::initialize.
sourcefn 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 recreate all of the data in the node.
sourcefn 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).
sourceimpl PartialEq<MaxSubArraySum> for MaxSubArraySum
impl PartialEq<MaxSubArraySum> for MaxSubArraySum
sourcefn eq(&self, other: &MaxSubArraySum) -> bool
fn eq(&self, other: &MaxSubArraySum) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MaxSubArraySum) -> bool
fn ne(&self, other: &MaxSubArraySum) -> bool
This method tests for !=
.
impl Eq for MaxSubArraySum
impl StructuralEq for MaxSubArraySum
impl StructuralPartialEq for MaxSubArraySum
Auto Trait Implementations
impl RefUnwindSafe for MaxSubArraySum
impl Send for MaxSubArraySum
impl Sync for MaxSubArraySum
impl Unpin for MaxSubArraySum
impl UnwindSafe for MaxSubArraySum
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more