Search Results for

    Show / Hide Table of Contents

    Class MiddleIndexPivotSelectionStrategy

    A IPivotSelectionStrategy always picking the index of the window in the middle.

    Inheritance
    System.Object
    MiddleIndexPivotSelectionStrategy
    Implements
    IPivotSelectionStrategy
    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()
    Namespace: MoreStructures.Lists.Sorting.QuickSort
    Assembly: MoreStructures.dll
    Syntax
    public class MiddleIndexPivotSelectionStrategy : IPivotSelectionStrategy
    Remarks

    Time and Space Complexity are O(1).
    Like for StartIndexPivotSelectionStrategy and EndIndexPivotSelectionStrategy, it makes quicksort run in quadratic time on pathological input configurations.
    However, unlike StartIndexPivotSelectionStrategy and EndIndexPivotSelectionStrategy, the pathological scenarios are much more unlikely to happen in the wild, and usually have to be manually crafted.
    To further reduce the possibility of phatological scenarios, and make sure that the resulting quicksort doesn't behave consistently bad on the same input, setup a IShuffleStrategy in the RecursiveQuickSort instance, different from IdentityShuffleStrategy.

    Methods

    | Improve this Doc View Source

    Select<T>(IList<T>, IComparer<T>, Int32, Int32)

    Declaration
    public int Select<T>(IList<T> list, IComparer<T> comparer, int start, int end)
    Parameters
    Type Name Description
    IList<T> list
    IComparer<T> comparer
    System.Int32 start
    System.Int32 end
    Returns
    Type Description
    System.Int32
    Type Parameters
    Name Description
    T
    Remarks

    This specific implementation always picks the end index.

    Implements

    IPivotSelectionStrategy

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX