Show / Hide Table of Contents

    Class IntroSorter

    Sorter implementation based on a variant of the quicksort algorithm called introsort: when the recursion level exceeds the log of the length of the array to sort, it falls back to heapsort. This prevents quicksort from running into its worst-case quadratic runtime. Small arrays are sorted with insertion sort.

    This is a Lucene.NET INTERNAL API, use at your own risk
    Inheritance
    System.Object
    Sorter
    IntroSorter
    Inherited Members
    Sorter.Compare(Int32, Int32)
    Sorter.Swap(Int32, Int32)
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class IntroSorter : Sorter

    Constructors

    | Improve this Doc View Source

    IntroSorter()

    Create a new IntroSorter.

    Declaration
    public IntroSorter()

    Methods

    | Improve this Doc View Source

    ComparePivot(Int32)

    Compare the pivot with the slot at j, similarly to Compare(i, j) (Compare(Int32, Int32)).

    Declaration
    protected abstract int ComparePivot(int j)
    Parameters
    Type Name Description
    System.Int32 j
    Returns
    Type Description
    System.Int32
    | Improve this Doc View Source

    SetPivot(Int32)

    Save the value at slot i so that it can later be used as a pivot, see ComparePivot(Int32).

    Declaration
    protected abstract void SetPivot(int i)
    Parameters
    Type Name Description
    System.Int32 i
    | Improve this Doc View Source

    Sort(Int32, Int32)

    Sort the slice which starts at from (inclusive) and ends at to (exclusive).

    Declaration
    public override sealed void Sort(int from, int to)
    Parameters
    Type Name Description
    System.Int32 from
    System.Int32 to
    Overrides
    Sorter.Sort(Int32, Int32)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)