CircularListTFindLastIndex(Int32, PredicateT) Method

Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the CircularListT that extends from the first element to the specified index.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
C#
public int FindLastIndex(
	int index,
	Predicate<T> match
)

Parameters

index  Int32
The zero-based starting index of the backward search.
match  PredicateT
A delegate that defines the conditions of the element to search for.

Return Value

Int32
The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1.

Remarks

This method performs a linear search; therefore, this method is an O(n) operation.

See Also