Library
Module
Module type
Parameter
Class
Class type
include Mergeable_vector with type t = string and type atom = char
include Vector with type t = string with type atom = char
val length : t -> int
Length of vector.
set v i e
updates the element at position i
in v
to e
.
Raise Invalid_argument "index out of bounds"
if i
is outside the range 0 to length v - 1
.
get v i
returns the element at position i
in v
.
Raise Invalid_argument "index out of bounds"
if i
is outside the range 0 to length v - 1
.
insert v i e
inserts the element e
at position i
in v
.
Raise Invalid_argument "index out of bounds"
if i
is outside the range 0 to length v
.
diff a b
returns a patch p
such that apply a p = b
. The difference is computed by Wagner-Fischer algorithm. O(length(a) * length(b)) time and space.
apply a p
applies the compatibe patch p
on a
.
Raise Invalid_argument "incompatible patch"
if the patch cannot be applied.