slice

package
v0.0.0-...-59788d5 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package Int64 simply adds an Int64-typed version of the standard library's sort/IntSlice implementation.

Also added is an Insert method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int64Slice

type Int64Slice []int64

Int64Slice is a slice that fulfills the sort.Interface interface.

func (Int64Slice) Exists

func (s Int64Slice) Exists(x int64) bool

Exists returns a bool indicating if the provided value exists in this list. This has undefined behavior if the list is not sorted.

func (Int64Slice) Insert

func (s Int64Slice) Insert(x int64) Int64Slice

Insert will insert x into the sorted position in this list and return a list with the value added. If this slice has not been sorted Insert's behavior is undefined.

func (Int64Slice) Len

func (s Int64Slice) Len() int

Len returns the len of this slice. Required by sort.Interface.

func (Int64Slice) Less

func (s Int64Slice) Less(i, j int) bool

Less returns a bool indicating if the value at position i is less than at position j. Required by sort.Interface.

func (Int64Slice) Search

func (s Int64Slice) Search(x int64) int

Search will search this slice and return an index that corresponds to the lowest position of that value. You'll need to check separately if the value at that position is equal to x. The behavior of this method is undefinited if the slice is not sorted.

func (Int64Slice) Sort

func (s Int64Slice) Sort()

Sort will in-place sort this list of int64s.

func (Int64Slice) Swap

func (s Int64Slice) Swap(i, j int)

Swap will swap the elements at positions i and j. This is required by sort.Interface.

Directories

Path Synopsis
Package skip defines a skiplist datastructure.
Package skip defines a skiplist datastructure.

Jump to

Keyboard shortcuts

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