- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for siftDown (0.32 sec)
-
src/sort/gen_sort_variants.go
for i := a + 1; i < b; i++ { for j := i; j > a && {{Less "data" "j" "j-1"}}; j-- { {{Swap "data" "j" "j-1"}} } } } // siftDown{{.FuncSuffix}} implements the heap property on data[lo:hi]. // first is an offset into the array where the root of the heap lies. func siftDown{{.FuncSuffix}}{{.TypeParam}}(data {{.DataType}}, lo, hi, first int {{.ExtraParam}}) { root := lo for { child := 2*root + 1 if child >= hi {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 19 23:33:27 UTC 2023 - 19.6K bytes - Viewed (0) -
src/runtime/time.go
break } heap[i] = heap[p] i = p } if heap[i].timer != tw.timer { heap[i] = tw } } // siftDown puts the timer at position i in the right place // in the heap by moving it down toward the bottom of the heap. func (ts *timers) siftDown(i int) { heap := ts.heap n := len(heap) if i >= n { badTimer() } if i*timerHeapN+1 >= n { return }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 29 14:36:24 UTC 2024 - 37.5K bytes - Viewed (0)