mkqsort

package
v0.0.0-...-3726d21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2013 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package sort implemenets multikey quicksort.

Index

Constants

View Source
const (
	CompareResultLess    = CompareResult(-1)
	CompareResultEqual   = CompareResult(0)
	CompareResultGreater = CompareResult(1)
)

Variables

This section is empty.

Functions

func Sort

func Sort(data Interface)

Sort sorts data by multiKeyQuickSort.

Types

type CompareResult

type CompareResult int

type Interface

type Interface interface {
	// Len is len(data).
	Len() int
	// DataLen is len(data[i]).
	DataLen() int
	// CompareAt compares data[i][idx] and data[j][idx].
	CompareAt(i, j, idx int) CompareResult
	// Swap swaps the elements with indexes i and j.
	Swap(i, j int)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL