educativeingo

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 4 Imported by: 0

README

educativeingo

programming practice in go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountPathsOfSum

func CountPathsOfSum(root *treeNode, sum int) int

CountPathsOfSum counts all the paths that adds up to a particular sum

func CyclicSort

func CyclicSort(nums []int) []int

CyclicSort performs cyclic sort

func FindAllPaths

func FindAllPaths(root *treeNode, sum int) [][]int

FindAllPaths that add up to the given sum

func FindDiameter

func FindDiameter(root *treeNode) int

FindDiameter of a tree

func FindMaxProfit

func FindMaxProfit(caps []int, profits []int, initCap int, numProjs int) int

FindMaxProfit finds max profit

func FindNextInterval

func FindNextInterval(intervals [][]int) []int

FindNextInterval find all the next intervals

func FindPathWGivenSequence

func FindPathWGivenSequence(root *treeNode, seq []int) bool

FindPathWGivenSequence finds the path with a given sequence

func FindPermutations

func FindPermutations(nums []int) [][]int

FindPermutations finds all permutations

func FindPermutationsRecursive

func FindPermutationsRecursive(nums []int) [][]int

FindPermutationsRecursive finds the above recursively

func FindSlidingWindowMedian

func FindSlidingWindowMedian(nums []int, k int) []float32

FindSlidingWindowMedian finds a

func FindSubsets

func FindSubsets(nums []int) [][]int

FindSubsets of all give sets

func FindSumOfPathNumbers

func FindSumOfPathNumbers(root *treeNode) int

FindSumOfPathNumbers of all the numbers represented by all paths

func FindUniqueSubsets

func FindUniqueSubsets(nums []int) [][]int

FindUniqueSubsets finds all unique subsets

func HasPath

func HasPath(root *treeNode, sum int) bool

HasPath that add up to a given sum

func SumOfPathWMaxSum

func SumOfPathWMaxSum(root *treeNode) int

SumOfPathWMaxSum of a tree

Types

type MedianOfStream

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

MedianOfStream gives a median of stream

func Constructor

func Constructor() MedianOfStream

Constructor median of stream

func (*MedianOfStream) FindMedian

func (m *MedianOfStream) FindMedian() float32

FindMedian finds a median of stream of numbers

func (*MedianOfStream) InsertNum

func (m *MedianOfStream) InsertNum(num int)

InsertNum inserts a number into stream

Jump to

Keyboard shortcuts

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