diff --git a/src/FSharp.Core/set.fsi b/src/FSharp.Core/set.fsi index d60432fcd0b..693953bce85 100644 --- a/src/FSharp.Core/set.fsi +++ b/src/FSharp.Core/set.fsi @@ -25,6 +25,8 @@ type Set<[] 'T when 'T: comparison> = /// /// The result set. /// + /// Time complexity: O(n log n). Space complexity: O(n). + /// /// /// /// let sequenceOfNumbers = seq { 1 .. 3 } @@ -43,6 +45,8 @@ type Set<[] 'T when 'T: comparison> = /// /// The result set. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(1).Add(2) @@ -60,6 +64,8 @@ type Set<[] 'T when 'T: comparison> = /// /// The result set. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(1).Add(2) @@ -71,6 +77,8 @@ type Set<[] 'T when 'T: comparison> = /// The number of elements in the set /// + /// Time complexity: O(n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(1).Add(2) @@ -86,6 +94,8 @@ type Set<[] 'T when 'T: comparison> = /// /// True if the set contains value. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(2).Add(3) @@ -97,6 +107,8 @@ type Set<[] 'T when 'T: comparison> = /// A useful shortcut for Set.isEmpty. See the Set module for further operations on sets. /// + /// Time complexity: O(1). Space complexity: O(1). + /// /// /// /// let set = Set.empty.Add(2).Add(3) @@ -264,6 +276,8 @@ module Set = /// The empty set for the type 'T. /// + /// Time complexity: O(1). Space complexity: O(1). + /// /// /// /// Set.empty<int> @@ -280,6 +294,8 @@ module Set = /// /// The set containing value. /// + /// Time complexity: O(1). Space complexity: O(1). + /// /// /// /// Set.singleton 7 @@ -297,6 +313,8 @@ module Set = /// /// A new set containing value. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(1).Add(2) @@ -314,6 +332,8 @@ module Set = /// /// True if element is in set. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(2).Add(3) @@ -331,6 +351,8 @@ module Set = /// /// True if set1 is a subset of set2. /// + /// Time complexity: O(m log n) where m and n are the sizes of set1 and set2 respectively. Space complexity: O(log n). + /// /// /// /// let set1 = Set.empty.Add(1).Add(2).Add(3) @@ -350,6 +372,8 @@ module Set = /// /// True if set1 is a proper subset of set2. /// + /// Time complexity: O(m log n) where m and n are the sizes of set1 and set2 respectively. Space complexity: O(log n). + /// /// /// /// let set1 = Set.empty.Add(1).Add(2).Add(3) @@ -368,6 +392,8 @@ module Set = /// /// True if set1 is a superset of set2. /// + /// Time complexity: O(m log n) where m and n are the sizes of set2 and set1 respectively. Space complexity: O(log n). + /// /// /// /// let set1 = Set.empty.Add(1).Add(2).Add(3) @@ -387,6 +413,8 @@ module Set = /// /// True if set1 is a proper superset of set2. /// + /// Time complexity: O(m log n) where m and n are the sizes of set2 and set1 respectively. Space complexity: O(log n). + /// /// /// /// let set1 = Set.empty.Add(1).Add(2).Add(3) @@ -404,6 +432,8 @@ module Set = /// /// The number of elements in the set. /// + /// Time complexity: O(n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -423,6 +453,8 @@ module Set = /// /// True if any element of set satisfies predicate. /// + /// Time complexity: O(n) worst case. Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -441,6 +473,8 @@ module Set = /// /// The set containing only the elements for which predicate returns true. /// + /// Time complexity: O(n log n). Space complexity: O(n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3).Add(4) @@ -459,6 +493,8 @@ module Set = /// /// A set containing the transformed elements. /// + /// Time complexity: O(n log n). Space complexity: O(n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -477,6 +513,8 @@ module Set = /// /// The final state. /// + /// Time complexity: O(n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -500,6 +538,8 @@ module Set = /// /// The final state. /// + /// Time complexity: O(n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -522,6 +562,8 @@ module Set = /// /// True if all elements of set satisfy predicate. /// + /// Time complexity: O(n) worst case. Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -539,6 +581,8 @@ module Set = /// /// The intersection of set1 and set2. /// + /// Time complexity: O(m log n) where m and n are the sizes of set1 and set2 respectively. Space complexity: O(min(m, n)). + /// /// /// /// let set1 = Set.empty.Add(1).Add(2).Add(3) @@ -556,6 +600,8 @@ module Set = /// /// The intersection of the input sets. /// + /// Time complexity: O(k * m log n) where k is the number of sets, m is the average size of sets, and n is the size of the largest set. Space complexity: O(n). + /// /// /// /// let headersByFile = seq{ @@ -582,6 +628,8 @@ module Set = /// /// The union of set1 and set2. /// + /// Time complexity: O(m log n) where m and n are the sizes of set1 and set2 respectively. Space complexity: O(m + n). + /// /// /// /// let set1 = Set.empty.Add(1).Add(2).Add(3) @@ -599,6 +647,8 @@ module Set = /// /// The union of the input sets. /// + /// Time complexity: O(k * m log n) where k is the number of sets, m is the average size of sets, and n is the size of the result set. Space complexity: O(total elements). + /// /// /// /// let headersByFile = seq{ @@ -624,6 +674,8 @@ module Set = /// /// True if set is empty. /// + /// Time complexity: O(1). Space complexity: O(1). + /// /// /// /// let set = Set.empty.Add(2).Add(3) @@ -640,6 +692,8 @@ module Set = /// The function to apply to each element. /// The input set. /// + /// Time complexity: O(n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -662,6 +716,8 @@ module Set = /// A pair of sets with the first containing the elements for which predicate returns /// true and the second containing the elements for which predicate returns false. /// + /// Time complexity: O(n log n). Space complexity: O(n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3).Add(4) @@ -680,6 +736,8 @@ module Set = /// /// The input set with value removed. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -696,6 +754,8 @@ module Set = /// /// The min value from the set. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -712,6 +772,8 @@ module Set = /// /// The max value from the set. /// + /// Time complexity: O(log n). Space complexity: O(log n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -728,6 +790,8 @@ module Set = /// /// A set containing the elements form the input list. /// + /// Time complexity: O(n log n). Space complexity: O(n). + /// /// /// /// let set = Set.ofList [1, 2, 3] @@ -744,6 +808,8 @@ module Set = /// /// An ordered list of the elements of set. /// + /// Time complexity: O(n). Space complexity: O(n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -761,6 +827,8 @@ module Set = /// /// A set containing the elements of array. /// + /// Time complexity: O(n log n). Space complexity: O(n). + /// /// /// /// let set = Set.ofArray [|1, 2, 3|] @@ -777,6 +845,8 @@ module Set = /// /// An ordered array of the elements of set. /// + /// Time complexity: O(n). Space complexity: O(n). + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -794,6 +864,8 @@ module Set = /// /// An ordered sequence of the elements of set. /// + /// Time complexity: O(1) for sequence creation, O(n) for full enumeration. Space complexity: O(log n) during enumeration. + /// /// /// /// let set = Set.empty.Add(1).Add(2).Add(3) @@ -811,6 +883,8 @@ module Set = /// /// The set containing elements. /// + /// Time complexity: O(n log n). Space complexity: O(n). + /// /// /// /// let set = Set.ofSeq [1, 2, 3] @@ -828,6 +902,8 @@ module Set = /// /// The set with the elements of set2 removed from set1. /// + /// Time complexity: O(m log n) where m and n are the sizes of set2 and set1 respectively. Space complexity: O(n). + /// /// /// /// let set1 = Set.empty.Add(1).Add(2).Add(3)