MkSeqElt
functorfunctor MkSeqElt (
structure Elt :
ELEMENT
structure Seq :
SEQUENCE
):
ELEMENT
where type t = Elt.t Seq.t =
MkSeqElt
Cost SpecificationWork | Span | |
equal (A,B)
|
O(min(|A|,|B|)−1∑i=0Wequal(A[i],B[i])) | O(max |
compare (A, B) |
O( \sum_{i=0}^{\text{min}(|A|, |B|) - 1} W_{\text{compare}}(A[i], B[i]) ) | O( \max_{i=0}^{\text{min}(|A|, |B|) - 1} S_{\text{compare}}(A[i], B[i]) ) |
hash A |
O( \sum_{i=0}^{|A| - 1} W_{\text{hash}}(A[i]) ) | O( \max_{i=0}^{|A| - 1} S_{\text{hash}}(A[i]) ) |
toString A |
O( \sum_{i=0}^{|A| - 1} W_{\text{toString}}(A[i]) ) | O( \max_{i=0}^{|A| - 1} S_{\text{toString}}(A[i]) ) |