hash

package
v0.0.0-...-ba76322 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0, Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DailyTemperature

func DailyTemperature(temps []int) []int

use an array of temperatures for lookup go reverse and save the latest index in lookup with the current temp search for min index for all temps > current from lookup

func FindDuplicate

func FindDuplicate(files []File) [][]File

func FindDuplicateMain

func FindDuplicateMain(paths []string) [][]string

func FindFrequentTreeSum

func FindFrequentTreeSum(root *TreeNode) []int

func FindKFrequent

func FindKFrequent(elements []int, size int) []int

func FindSmallestCommon

func FindSmallestCommon(matrix [][]int) int

Note nested maps are requited for duplicates map[value]m ap[rownum]bool

func FlipColumsEqualRows

func FlipColumsEqualRows(matrix [][]int) int

func ReplaceWords

func ReplaceWords(dict []string, sentence string) string

func SortCharByFreq

func SortCharByFreq(str string) string

func TableOrdersMain

func TableOrdersMain(orders []Orders) [][]string

Types

type BinaryTreeNode

type BinaryTreeNode struct {
	Value int
	Left  *BinaryTreeNode
	Right *BinaryTreeNode
}

type File

type File struct {
	DirName  string
	FileName string
	Content  string
}

type FindElements

type FindElements struct {
	Root *BinaryTreeNode
}

func Constructor

func Constructor(root *BinaryTreeNode) FindElements

func (*FindElements) Find

func (f *FindElements) Find(target int) bool

func (*FindElements) Print

func (f *FindElements) Print()

type LeaderBoard

type LeaderBoard struct {
	Lookup map[int]*list.Element
	List   list.List
}

func (*LeaderBoard) AddScore

func (lb *LeaderBoard) AddScore(playerID int, score int)

O(n)

func (*LeaderBoard) Print

func (lb *LeaderBoard) Print()

O(n)

func (*LeaderBoard) Reset

func (lb *LeaderBoard) Reset(playerID int)

O(1)

func (*LeaderBoard) Top

func (lb *LeaderBoard) Top(count int) int

O(count)

type Orders

type Orders struct {
	TableNum int
	Dish     string
}

type Player

type Player struct {
	PlayerID int
	Score    int
}

type TinyURL

type TinyURL struct {
	// contains filtered or unexported fields
}

func NewTinyURL

func NewTinyURL() TinyURL

func (*TinyURL) Decode

func (t *TinyURL) Decode(short string) string

func (*TinyURL) Encode

func (t *TinyURL) Encode(long string) string

type TreeNode

type TreeNode struct {
	Val   int
	Left  *TreeNode
	Right *TreeNode
}

type TwoSum

type TwoSum struct {
	// contains filtered or unexported fields
}

Duplicates

func NewTwoSum

func NewTwoSum() TwoSum

func (*TwoSum) Add

func (t *TwoSum) Add(value int)

func (*TwoSum) Find

func (t *TwoSum) Find(value int) bool

Jump to

Keyboard shortcuts

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