Documentation ¶
Index ¶
- func KMinElement(arr []int, k int) []int
- func ReverseBits(x uint8) uint8
- func ShuffleArray(in []int) []int
- func TwoSums(arr1, arr2 []int, target int) [][]int
- func TwoSumsClosestBruetForce(arr1, arr2 []int, target int) [][]int
- func TwoSumsClosestSorting(arr1, arr2 []int, target int) [][]int
- type IntMaxHeap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KMinElement ¶
KMinElement finds K smallest items from array
func ReverseBits ¶
ReverseBits reverse bits in x. The time complexity is O(n) where n is the word size. The space complexity is O(1).
func ShuffleArray ¶
func TwoSumsClosestSorting ¶
Types ¶
type IntMaxHeap ¶
type IntMaxHeap []int
IntMaxHeap implements Max Heap
func (IntMaxHeap) Len ¶
func (h IntMaxHeap) Len() int
func (IntMaxHeap) Less ¶
func (h IntMaxHeap) Less(i, j int) bool
func (*IntMaxHeap) Pop ¶
func (h *IntMaxHeap) Pop() interface{}
Pop use pointer receivers because they modify the slice's length, not just its contents.
func (*IntMaxHeap) Push ¶
func (h *IntMaxHeap) Push(x interface{})
Push use pointer receivers because they modify the slice's length, not just its contents.
func (IntMaxHeap) Swap ¶
func (h IntMaxHeap) Swap(i, j int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.