Documentation
¶
Index ¶
- func BinarySearch(arr []int, l, r, value int) int
- func CharToInt(char rune) int
- func IntToChar(intNum int) interface{}
- func IntToStr(intValue int) string
- func LowerBound(arr []int, l, r, value int) int
- func MaxValue(compValue, compedValue int) int
- func MinValue(compValue, compedValue int) int
- func MyAbs(value int) int
- func StrToInt(str string) int
- func UpperBound(arr []int, l, r, value int) int
- type MySort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinarySearch ¶
BinarySearch must be sorted Arr else Meaningless but the algo is not accurate when the same element occurs over twice times.
func LowerBound ¶
LowerBound from l find the first arr[i] <= value example. {10,10,20,20,20,20,30,30},0,7,20 return index is 2 algo complex is O(log(r-l))
func UpperBound ¶
UpperBound from r find the first arr[i] > value example. {10,10,20,20,20,20,30,30},0,7,20 return index is 6 algo complex is O(log(r-l))
Types ¶
Click to show internal directories.
Click to hide internal directories.