Fork me on GitHub
  • API

    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.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    Inheritance
    object
    Sorter
    IntroSorter
    Inherited Members
    Sorter.Compare(int, int)
    Sorter.Swap(int, int)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class IntroSorter : Sorter

    Constructors

    IntroSorter()

    Create a new IntroSorter.

    Declaration
    protected IntroSorter()

    Methods

    ComparePivot(int)

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

    Declaration
    protected abstract int ComparePivot(int j)
    Parameters
    Type Name Description
    int j
    Returns
    Type Description
    int

    SetPivot(int)

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

    Declaration
    protected abstract void SetPivot(int i)
    Parameters
    Type Name Description
    int i

    Sort(int, int)

    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
    int from
    int to
    Overrides
    Sorter.Sort(int, int)
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.