Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for SortedStableFunc (0.16 sec)

  1. src/slices/iter_test.go

    	data := make(intPairs, n)
    	for i := range data {
    		data[i].a = rand.IntN(m)
    	}
    	data.initB()
    
    	s := intPairs(SortedStableFunc(Values(data), intPairCmp))
    	if !IsSortedFunc(s, intPairCmp) {
    		t.Errorf("SortedStableFunc didn't sort %d ints", n)
    	}
    	if !s.inOrder(false) {
    		t.Errorf("SortedStableFunc wasn't stable on %d ints", n)
    	}
    
    	// iterVal converts a Seq2 to a Seq.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  2. doc/next/6-stdlib/3-iter.md

    - [Sorted](/pkg/slices#Sorted) collects values from an iterator into a
      new slice, and then sorts the slice.
    - [SortedFunc](/pkg/slices#SortedFunc) is like `Sorted` but with a
      comparison function.
    - [SortedStableFunc](/pkg/slices#SortedStableFunc) is like `SortFunc`
      but uses a stable sort algorithm.
    - [Chunk](/pkg/slices#Chunk) returns an iterator over consecutive
      sub-slices of up to n elements of a slice.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:34:13 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  3. src/slices/iter.go

    	s := Collect(seq)
    	SortFunc(s, cmp)
    	return s
    }
    
    // SortedStableFunc collects values from seq into a new slice.
    // It then sorts the slice while keeping the original order of equal elements,
    // using the comparison function to compare elements.
    // It returns the new slice.
    func SortedStableFunc[E any](seq iter.Seq[E], cmp func(E, E) int) []E {
    	s := Collect(seq)
    	SortStableFunc(s, cmp)
    	return s
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 21:40:32 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  4. api/go1.23.txt

    pkg slices, func Repeat[$0 interface{ ~[]$1 }, $1 interface{}]($0, int) $0 #65238
    pkg slices, func SortedFunc[$0 interface{}](iter.Seq[$0], func($0, $0) int) []$0 #61899
    pkg slices, func SortedStableFunc[$0 interface{}](iter.Seq[$0], func($0, $0) int) []$0 #61899
    pkg slices, func Sorted[$0 cmp.Ordered](iter.Seq[$0]) []$0 #61899
    pkg slices, func Values[$0 interface{ ~[]$1 }, $1 interface{}]($0) iter.Seq[$1] #61899
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 20:48:49 UTC 2024
    - 8.4K bytes
    - Viewed (0)
Back to top