Class LinearSearch
An object able to search in linear time for items in direct random access structures, such as lists and
arrays, which are monodimensional and implement the interface.
Inheritance
System.Object
LinearSearch
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: MoreStructures.dll
Syntax
public class LinearSearch : ISearch
Methods
|
Improve this Doc
View Source
First<T>(IEnumerable<T>, T, Nullable<IComparer<T>>, Nullable<Int32>, Nullable<Int32>)
This specific implementation does not make any assunption on source
being sorted.
Declaration
public int First<T>(IEnumerable<T> source, T item, IComparer<T>? comparer = null, int? fromIndex = null, int? toIndex = null)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
source |
|
T |
item |
|
System.Nullable<IComparer<T>> |
comparer |
|
System.Nullable<System.Int32> |
fromIndex |
|
System.Nullable<System.Int32> |
toIndex |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
|
Improve this Doc
View Source
FirstAll<T>(IEnumerable<T>, Nullable<IComparer<T>>, Nullable<Int32>, Nullable<Int32>)
This specific implementation does not make any assunption on source
being sorted.
Declaration
public IDictionary<T, int> FirstAll<T>(IEnumerable<T> source, IComparer<T>? comparer = null, int? fromIndex = null, int? toIndex = null)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
source |
|
System.Nullable<IComparer<T>> |
comparer |
|
System.Nullable<System.Int32> |
fromIndex |
|
System.Nullable<System.Int32> |
toIndex |
|
Returns
Type |
Description |
IDictionary<T, System.Int32> |
|
Type Parameters
|
Improve this Doc
View Source
Interval<T>(IEnumerable<T>, T, Nullable<IComparer<T>>, Nullable<Int32>, Nullable<Int32>)
This specific implementation does not make any assunption on source
being sorted.
Declaration
public (int first, int last) Interval<T>(IEnumerable<T> source, T item, IComparer<T>? comparer = null, int? fromIndex = null, int? toIndex = null)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
source |
|
T |
item |
|
System.Nullable<IComparer<T>> |
comparer |
|
System.Nullable<System.Int32> |
fromIndex |
|
System.Nullable<System.Int32> |
toIndex |
|
Returns
Type |
Description |
System.ValueTuple<System.Int32, System.Int32> |
|
Type Parameters
|
Improve this Doc
View Source
Last<T>(IEnumerable<T>, T, Nullable<IComparer<T>>, Nullable<Int32>, Nullable<Int32>)
This specific implementation does not make any assunption on source
being sorted.
Declaration
public int Last<T>(IEnumerable<T> source, T item, IComparer<T>? comparer = null, int? fromIndex = null, int? toIndex = null)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
source |
|
T |
item |
|
System.Nullable<IComparer<T>> |
comparer |
|
System.Nullable<System.Int32> |
fromIndex |
|
System.Nullable<System.Int32> |
toIndex |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
|
Improve this Doc
View Source
Nth<T>(IEnumerable<T>, T, Int32, Nullable<IComparer<T>>, Nullable<Int32>, Nullable<Int32>)
This specific implementation does not make any assunption on source
being sorted.
Declaration
public int Nth<T>(IEnumerable<T> source, T item, int occurrenceRank, IComparer<T>? comparer = null, int? fromIndex = null, int? toIndex = null)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
source |
|
T |
item |
|
System.Int32 |
occurrenceRank |
|
System.Nullable<IComparer<T>> |
comparer |
|
System.Nullable<System.Int32> |
fromIndex |
|
System.Nullable<System.Int32> |
toIndex |
|
Returns
Type |
Description |
System.Int32 |
|
Type Parameters
Implements
Extension Methods