Set
Types
Tip
Bin
Functions
O(1). The empty set.
O(1). A set with a single element.
O(n * log n). Build a set from a list of elements.
O(n). Build a set from an ascending list of elements.
O(n). Build a set from a descending list of elements.
O(log n). Insert an element into the set.
O(log n). Delete an element from the set.
O(log n). Is the element a member of the set?
O(log n). Is the element not a member of the set?
O(log n). Find the largest element smaller than the given one.
O(log n). Find the smallest element larger than the given one.
O(log n). Find the largest element less than or equal to the given one.
O(log n). Find the smallest element greater than or equal to the given one.
O(1). Is the set empty?
O(1). The number of elements in the set.
O(n * log n). Is the first set a subset of the second?
O(n * log n). Is the first set a proper subset of the second?
O(m * log(n\m + 1)), m <= n/. Union of two sets.
O(m * log(n\m + 1)), m <= n/. Union of a foldable of sets.
O(m * log(n\m + 1)), m <= n/. Difference of two sets.
O(m * log(n\m + 1)), m <= n. Infix operator for difference<a>.
O(m * log(n\m + 1)), m <= n/. Intersection of two sets.
O(m * log(n\m + 1)), m <= n/. Check if two sets are disjoint (no common elements).
O(n). Filter elements satisfying a predicate.
O(n). Partition the set according to a predicate.
O(log n). Split the set at an element. Returns elements less than
O(n). Map a strictly monotonic function over the set.
O(n). Fold the elements using a right-associative operator.
O(n). Fold the elements using a left-associative operator.
O(n). Strict right fold.
O(n). Strict left fold.
O(log n). Lookup the minimum element.
O(log n). Lookup the maximum element.
O(log n). Find the minimum element.
O(log n). Find the maximum element.
O(log n). Delete the minimum element.
O(log n). Delete the maximum element.
O(log n). Retrieve and delete the minimum element.
O(log n). Retrieve and delete the maximum element.
O(n). Return all elements as a list in ascending order.
O(n). Convert to a list in ascending order.
O(n). Convert to an ascending list.
O(n). Convert to a descending list.