algorithms

package module
v0.0.0-...-52d6ee5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 1 Imported by: 0

README

go-algorithms

GoDoc Go Report Card Build Status codecov

The library implementing some basic algorithms and data structures.

  • algorithms:
  • data structures:
    • set:
      • operations:
        • checking that a set contains an item
        • adding an item
        • removing an item
        • evaluating union with another set
        • evaluating intersection with another set
        • evaluating difference between two sets
    • multiset:
      • operations:
        • checking that a set contains an item
        • adding an item
        • removing an item
        • evaluating sum with another set
        • evaluating union with another set
        • evaluating intersection with another set
        • evaluating difference between two sets

Installation

$ go get github.com/irenicaa/go-algorithms

License

The MIT License (MIT)

Copyright © 2022 irenica

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UniqueFast

func UniqueFast(items []interface{}) []interface{}

UniqueFast ...

Items should be hashable.

Types

type Equal

type Equal interface {
	Equal(other interface{}) bool
}

Equal ...

func SearchUniversal

func SearchUniversal(items []Equal, sample Equal) (Equal, bool)

SearchUniversal ...

func UniqueSorted

func UniqueSorted(items []Equal) []Equal

UniqueSorted ...

func UniqueUniversal

func UniqueUniversal(items []Equal) []Equal

UniqueUniversal ...

type Less

type Less interface {
	Less(other interface{}) bool
}

Less ...

func Maximum

func Maximum(items []Less) Less

Maximum ...

func MergeSorted

func MergeSorted(left []Less, right []Less) []Less

MergeSorted ...

func Minimum

func Minimum(items []Less) Less

Minimum ...

func SearchSorted

func SearchSorted(items []Less, sample Less) (Less, bool)

SearchSorted ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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