Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for insertionSortOrdered (0.26 sec)

  1. src/slices/zsortordered.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package slices
    
    import "cmp"
    
    // insertionSortOrdered sorts data[a:b] using insertion sort.
    func insertionSortOrdered[E cmp.Ordered](data []E, a, b int) {
    	for i := a + 1; i < b; i++ {
    		for j := i; j > a && cmp.Less(data[j], data[j-1]); j-- {
    			data[j], data[j-1] = data[j-1], data[j]
    		}
    	}
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 23 23:33:29 UTC 2023
    - 12.4K bytes
    - Viewed (0)
Back to top