DifferenceArrayUtils class
Difference array: apply add to range l..r in O(1), then recover array with toArray.
Constructors
- DifferenceArrayUtils(int length)
-
Creates a difference array backing a logical array of
lengthzeros.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addRange(
int l, int r, int delta) → void -
Adds
deltato the logical rangel..r(inclusive) in O(1). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toArray(
) → List< int> - Builds the final array from the difference array (prefix sum).
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited