Interface QuickSelect.Adapter<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      int compare​(T data, int i, int j)
      Compare two elements.
      default void isSorted​(T data, int begin, int end)
      Notification callback that an array is completely sorted.
      void swap​(T data, int i, int j)
      Swap the two elements at positions i and j.
    • Method Detail

      • swap

        void swap​(T data,
                  int i,
                  int j)
        Swap the two elements at positions i and j.
        Parameters:
        data - Data structure
        i - Position i
        j - Position j
      • compare

        int compare​(T data,
                    int i,
                    int j)
        Compare two elements.
        Parameters:
        data - Data structure
        i - Position i
        j - Position j
        Returns:
        -1,0,+1 when the element at position i is smaller, equal, or greater than that at position j.
      • isSorted

        default void isSorted​(T data,
                              int begin,
                              int end)
        Notification callback that an array is completely sorted.
        Parameters:
        data - Data structure
        begin - Begin of sorted interval
        end - End of sorted interval