You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// MARK: - Removing elements. This is mostly a reimplementation of part `RangeReplaceableCollection`'s interface. `SortedArray` can't conform to `RangeReplaceableCollection` because some of that protocol's semantics (e.g. `append(_:)` don't fit `SortedArray`'s semantics.
120
+
extensionSortedArray{
121
+
/// Removes and returns the element at the specified position.
122
+
///
123
+
/// - Parameter index: The position of the element to remove. `index` must be a valid index of the array.
124
+
/// - Returns: The element at the specified index.
125
+
/// - Complexity: O(_n_), where _n_ is the length of the array.
126
+
publicmutatingfunc remove(at index:Int)->Element{
127
+
return _elements.remove(at: index)
128
+
}
129
+
130
+
/// Removes the elements in the specified subrange from the array.
131
+
///
132
+
/// - Parameter bounds: The range of the array to be removed. The
133
+
/// bounds of the range must be valid indices of the array.
134
+
///
135
+
/// - Complexity: O(_n_), where _n_ is the length of the array.
0 commit comments