package
Version:
v0.0.0-...-e19c9e5
Opens a new window with list of versions in this module.
Published: Oct 31, 2021
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
-
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
func BinarySearch(arr []int, l, r, value int) int
BinarySearch must be sorted Arr else Meaningless
but the algo is not accurate when the same element occurs over twice times.
func IntToChar(intNum int) interface{}
func LowerBound(arr []int, l, r, value int) int
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 MaxValue(compValue, compedValue int) int
func MinValue(compValue, compedValue int) int
func UpperBound(arr []int, l, r, value int) int
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))
type MySort struct {
IsAsc bool
}
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.