cockroach: github.com/cockroachdb/cockroach/pkg/util/shuffle Index | Files

package shuffle

import "github.com/cockroachdb/cockroach/pkg/util/shuffle"

Index

Package Files

shuffle.go

func Shuffle Uses

func Shuffle(data Interface)

Shuffle randomizes the order of the array.

type Interface Uses

type Interface interface {
    // Len is the number of elements in the collection.
    Len() int
    // Swap swaps the elements with indexes i and j.
    Swap(i, j int)
}

Interface for shuffle. When it is satisfied, a collection can be shuffled by the routines in this package. The methods require that the elements of the collection be enumerable by an integer index. This interface is similar to sort.Interface.

Package shuffle imports 1 packages (graph) and is imported by 6 packages. Updated 2019-07-14. Refresh now. Tools for package owners.