Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for heapSortCmpFunc (0.1 sec)

  1. src/slices/zsortanyfunc.go

    			child++
    		}
    		if !(cmp(data[first+root], data[first+child]) < 0) {
    			return
    		}
    		data[first+root], data[first+child] = data[first+child], data[first+root]
    		root = child
    	}
    }
    
    func heapSortCmpFunc[E any](data []E, a, b int, cmp func(a, b E) int) {
    	first := a
    	lo := 0
    	hi := b - a
    
    	// Build heap with greatest element at top.
    	for i := (hi - 1) / 2; i >= 0; i-- {
    		siftDownCmpFunc(data, i, hi, first, cmp)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 23:33:29 UTC 2023
    - 12.8K bytes
    - Viewed (0)
Back to top