Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Static Public Member Functions | List of all members
Smooth.Collections.IListExtensions Class Reference

Extension methods for IList<>s. More...

Static Public Member Functions

static void InsertionSort< T > (this IList< T > ts)
 Sorts the specified list using an insertion sort algorithm and the default sort comparer for T. More...
 
static void InsertionSort< T > (this IList< T > ts, IComparer< T > comparer)
 Sorts the specified list using an insertion sort algorithm and the specified comparer. More...
 
static void InsertionSort< T > (this IList< T > ts, Comparison< T > comparison)
 Sorts the specified list using an insertion sort algorithm and the specified comparison. More...
 
static Option< T > Random< T > (this IList< T > list)
 If the specified list is empty, returns an empty option; otherwise, returns an option containing a random element from the specified list. More...
 
static void Shuffle< T > (this IList< T > ts)
 Shuffles the element order of the specified list. More...
 

Detailed Description

Extension methods for IList<>s.

Member Function Documentation

static void Smooth.Collections.IListExtensions.InsertionSort< T > ( this IList< T >  ts)
inlinestatic

Sorts the specified list using an insertion sort algorithm and the default sort comparer for T.

Insertion sort is a O(n²) time complexity algorithm and should not be used on arbitrary lists. However, it has a best case time complexity of O(n) for lists that are already sorted and is quite fast when used on nearly sorted input.

static void Smooth.Collections.IListExtensions.InsertionSort< T > ( this IList< T >  ts,
IComparer< T >  comparer 
)
inlinestatic

Sorts the specified list using an insertion sort algorithm and the specified comparer.

Insertion sort is a O(n²) time complexity algorithm and should not be used on arbitrary lists. However, it has a best case time complexity of O(n) for lists that are already sorted and is quite fast when used on nearly sorted input.

static void Smooth.Collections.IListExtensions.InsertionSort< T > ( this IList< T >  ts,
Comparison< T >  comparison 
)
inlinestatic

Sorts the specified list using an insertion sort algorithm and the specified comparison.

Insertion sort is a O(n²) time complexity algorithm and should not be used on arbitrary lists. However, it has a best case time complexity of O(n) for lists that are already sorted and is quite fast when used on nearly sorted input.

static Option<T> Smooth.Collections.IListExtensions.Random< T > ( this IList< T >  list)
inlinestatic

If the specified list is empty, returns an empty option; otherwise, returns an option containing a random element from the specified list.

static void Smooth.Collections.IListExtensions.Shuffle< T > ( this IList< T >  ts)
inlinestatic

Shuffles the element order of the specified list.


The documentation for this class was generated from the following file: