Documentation ¶
Index ¶
- func ContainerWithMostWater(arr []int) (int, int, int)
- func DiffK(arr []int, k int) (int, int)
- func DiffK2(arr []int, k int) (int, int)
- func DiffKBinary(arr []int, k int) int
- func GenerateParenthesis(n int) map[string]bool
- func GetRotatedIndex(arr []int) int
- func GroupAnagrams(words []string) [][]string
- func Intersection(a []int, b []int) []int
- func MaxContiguousSubarray(array []int) int
- func MaxProfit(arr []int) (int, int, int)
- func MaxProfit2(arr []int) (int, int, int)
- func PrintLCA(node *LCANode, ns int, ch byte)
- func RearrangeArray(arr []int) []int
- func RotateMatrix(matrix [][]string) [][]string
- func SearchRotatedArray(arr []int, searchVal int, rotatedIndex int) int
- func SortByColor(arr []int) []int
- func SortItems(n int, m int, group []int, beforeItems [][]int) []int
- func Stretch(root *StretchNode, amount int)
- func ThreeSum(arr []int, s int) (bool, int, int, int)
- func ThreeSumClosest(arr []int, sum int) (int, int, int, int)
- func TreeLargestDistance(array []int) int
- func TreeLargestDistance2(root *LDNode) int
- type BSTIterator
- type BiNode
- type FeedObject
- type Graph
- type GroupGraph
- type LCANode
- type LDNode
- type NDCache
- type StretchNode
- type TopoGraph
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerWithMostWater ¶
two pointers increment left if returns area, i, j
func DiffK2 ¶
two pointers same direction assumes sorted make sure to check pointers are not same location and check absolute difference is K
func GenerateParenthesis ¶
func GroupAnagrams ¶
func MaxContiguousSubarray ¶
func RearrangeArray ¶
func RotateMatrix ¶
func SearchRotatedArray ¶
split array into 2 by rotatedIndex and search in each
func Stretch ¶
func Stretch(root *StretchNode, amount int)
func ThreeSumClosest ¶
with duplicates after sorting two pointers are front and back. move only one pointer at a time depending on < sum or > dont forget absolute compare
func TreeLargestDistance ¶
func TreeLargestDistance2 ¶
Types ¶
type BSTIterator ¶
func (*BSTIterator) AddAll ¶
func (b *BSTIterator) AddAll(node *BiNode)
func (*BSTIterator) HasNext ¶
func (b *BSTIterator) HasNext() bool
func (*BSTIterator) Next ¶
func (b *BSTIterator) Next() string
func (*BSTIterator) Print ¶
func (b *BSTIterator) Print()
type FeedObject ¶
type FeedObject struct {
// contains filtered or unexported fields
}
type GroupGraph ¶
type StretchNode ¶
type StretchNode struct { Value int Left *StretchNode Right *StretchNode }
Source Files ¶
- 3-sum-closest.go
- alien-dictionary.go
- bst-iterator.go
- buy-sell-stocks-1.go
- container-with-most-water.go
- diff-k.go
- generate-paranthesis.go
- group-anagrams.go
- group-items.go
- intersection-of-sorted-arrays.go
- least-common-ancestor-lca.go
- lru-cache.go
- max-contiguous-subarray.go
- nightfall.go
- rearrange-array.go
- regex-match.go
- rotate-array.go
- rotate-matrix.go
- rotated-array.go
- sort-by-color.go
- sort-group.go
- topo-sort.go
- tree-largest-distance.go
Click to show internal directories.
Click to hide internal directories.