intersect

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: MIT Imports: 2 Imported by: 37

README

go-intersect

Find the intersection of two iterable values.

This library provides multiple implementations which each have their strong and weak points.

Read the docs.

Build Status

Installation

$ go get github.com/juliangruber/go-intersect

Example

import "github.com/juliangruber/go-intersect"
import "fmt"

func main() {
  a := []int{1, 2, 3}
  b := []int{2, 3, 4}
  fmt.Println(intersect.Simple(a, b))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(a interface{}, b interface{}) []interface{}

Hash has complexity: O(n * x) where x is a factor of hash function efficiency (between 1 and 2)

func Simple

func Simple(a interface{}, b interface{}) []interface{}

Simple has complexity: O(n^2)

func Sorted

func Sorted(a interface{}, b interface{}) []interface{}

Sorted has complexity: O(n * log(n)), a needs to be sorted

Types

This section is empty.

Jump to

Keyboard shortcuts

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