Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for choosePivot (0.13 sec)

  1. src/sort/zsortinterface.go

    			if other >= length {
    				other -= length
    			}
    			data.Swap(idx, a+other)
    		}
    	}
    }
    
    // choosePivot chooses a pivot in data[a:b].
    //
    // [0,8): chooses a static pivot.
    // [8,shortestNinther): uses the simple median-of-three method.
    // [shortestNinther,∞): uses the Tukey ninther method.
    func choosePivot(data Interface, a, b int) (pivot int, hint sortedHint) {
    	const (
    		shortestNinther = 50
    		maxSwaps        = 4 * 3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 13 20:16:24 UTC 2022
    - 11.2K bytes
    - Viewed (0)
  2. src/sort/gen_sort_variants.go

    				other -= length
    			}
    			{{Swap "data" "idx" "a+other"}}
    		}
    	}
    }
    
    // choosePivot{{.FuncSuffix}} chooses a pivot in data[a:b].
    //
    // [0,8): chooses a static pivot.
    // [8,shortestNinther): uses the simple median-of-three method.
    // [shortestNinther,∞): uses the Tukey ninther method.
    func choosePivot{{.FuncSuffix}}{{.TypeParam}}(data {{.DataType}}, a, b int {{.ExtraParam}}) (pivot int, hint sortedHint) {
    	const (
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 19.6K bytes
    - Viewed (0)
Back to top