CircularSortedListTKey, TValueRemove Method

Removes the element with the specified key from the CircularSortedListTKey, TValue.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public bool Remove(
	TKey key
)

Parameters

key  TKey
The key of the element to remove.

Return Value

Boolean
if the element is successfully removed; otherwise, .

Implements

IDictionaryTKey, TValueRemove(TKey)

Remarks

This method performs a binary search; however, the elements are moved up to fill in the open spot. So this method is an O(log n) operation, when the first or last element is removed; otherwise, O(n), where n is Count. If it is known that the first or last element should be removed, use RemoveAt(Int32) instead, which is an O(1) operation in this case.

Exceptions

See Also