MCPcopy Create free account

hub / github.com/TheAlgorithms/Go / functions

Functions1,378 in github.com/TheAlgorithms/Go

↓ 2 callersFunctionProblem3
(n uint)
project_euler/problem_3/problem3.go:12
↓ 2 callersFunctionProblem4
()
project_euler/problem_4/problem4.go:19
↓ 2 callersFunctionProblem5
(limit uint)
project_euler/problem_5/problem5.go:13
↓ 2 callersFunctionProblem6
(n uint)
project_euler/problem_6/problem6.go:21
↓ 2 callersFunctionProblem7
(n uint)
project_euler/problem_7/problem7.go:16
↓ 2 callersFunctionProblem8
(window int)
project_euler/problem_8/problem8.go:16
↓ 2 callersFunctionProblem9
()
project_euler/problem_9/problem9.go:17
↓ 2 callersFunctionPronicNumber
PronicNumber returns true if argument passed to the function is pronic and false otherwise.
math/pronicnumber.go:17
↓ 2 callersMethodPush
(i Comparable)
sort/heapsort.go:53
↓ 2 callersFunctionRGBToHEX
RGBToHEX does exactly the opposite of HEXToRGB: it combines the three components red, green and blue to an RGB value, which can be converted to e.g. H
conversion/rgbhex.go:43
↓ 2 callersFunctionRLEdecode
RLEdecode takes a run-length encoded string and returns the original string
compression/rlecoding.go:37
↓ 2 callersFunctionRLEdecodebytes
RLEdecodebytes takes a run-length encoded byte slice and returns the original byte slice
compression/rlecoding.go:67
↓ 2 callersFunctionRLEncode
RLEncode takes a string and returns its run-length encoding
compression/rlecoding.go:22
↓ 2 callersFunctionRLEncodebytes
RLEncodebytes takes a byte slice and returns its run-length encoding as a byte slice
compression/rlecoding.go:50
↓ 2 callersMethodRear
Rear gets the last item from queue.
structure/deque/deque.go:68
↓ 2 callersFunctionRecursive
Recursive finds and returns the greatest common divisor of a given integer.
math/gcd/gcd.go:7
↓ 2 callersFunctionRecursivePower
RecursivePower is recursive O(logn) function for pow(x, y)
math/power/fastexponent.go:18
↓ 2 callersFunctionRecursivePower1
RecursivePower1 is recursive O(n) function for pow(x, y)
math/power/fastexponent.go:30
↓ 2 callersMethodRemove
(n *Node[T])
structure/linkedlist/doubly.go:67
↓ 2 callersMethodReverse
Reverse Reverse the order of the linkedlist
structure/linkedlist/doubly.go:153
↓ 2 callersFunctionReverseBits
ReverseBits This function initialized the result by 0 (all bits 0) and process the given number starting from its least significant bit. If the curren
math/binary/reversebits.go:16
↓ 2 callersFunctionSelectK
(array []int, k int)
search/selectk.go:3
↓ 2 callersFunctionSequenceGrayCode
SequenceGrayCode The function generates an "Gray code" sequence of length n
math/binary/rbc.go:13
↓ 2 callersFunctionSieve
Sieve Sieving the numbers that are not prime from the channel - basically removing them from the channels
math/prime/sieve.go:16
↓ 2 callersFunctionSqrt
(n float32)
math/binary/sqrt.go:12
↓ 2 callersFunctionTemplateBenchmarkExtendedGCD
(b *testing.B, f testExtendedFunction)
math/gcd/extendedgcd_test.go:44
↓ 2 callersFunctionTemplateBenchmarkGCD
(b *testing.B, f testFunction)
math/gcd/gcd_test.go:37
↓ 2 callersFunctionTemplateTestExtendedGCD
(t *testing.T, f testExtendedFunction)
math/gcd/extendedgcd_test.go:7
↓ 2 callersFunctionTemplateTestGCD
(t *testing.T, f testFunction)
math/gcd/gcd_test.go:18
↓ 2 callersFunctionTwin
This function returns twin prime for given number returns (n + 2) if both n and (n + 2) are prime -1 otherwise
math/prime/twin.go:17
↓ 2 callersFunctionUpperBound
UpperBound returns index to the first element in the range [lowIndex, len(array)-1] that is greater than target. return -1 and ErrNotFound if no such
search/binary.go:64
↓ 2 callersFunctionUsingLog
(a float64, b float64)
math/power/powvialogarithm.go:16
↓ 2 callersFunctionVerify
Verify is signature verification for DSA 1. Compute w = s^-1 mod q 2. Compute u1 = (H(m) * w) mod q 3. Compute u2 = (r * w) mod q 4. Compute v = ((g^u
cipher/dsa/dsa.go:157
↓ 2 callersMethodVerify
(tree *BTree[T])
structure/tree/btree.go:45
↓ 2 callersFunctionXorSearchMissingNumber
XorSearchMissingNumber This function finds a missing number in a sequence
math/binary/xorsearch.go:13
↓ 2 callersFunctionalmostEqual
almostEqual subtracts two float64 variables and returns true if they differ less then float64EqualityThreshold reference: https://stackoverflow.com/a/
graph/floydwarshall_test.go:12
↓ 2 callersFunctionassertRot13Output
(t *testing.T, input, expected string)
cipher/rot13/rot13_test.go:64
↓ 2 callersMethodbackQueue
backQueue it will return the back data
structure/queue/queuelinkedlist.go:75
↓ 2 callersFunctioncleanString
(text string)
strings/palindrome/ispalindrome.go:19
↓ 2 callersFunctioncutRodSolTestFunc
(t *testing.T, cutRodSolFunc func([]int, int) int)
dynamic/rodcutting_test.go:24
↓ 2 callersMethoddfs
(int, int)
graph/lowestcommonancestor.go:20
↓ 2 callersFunctionencryptDecryptInt
encryptDecryptInt encrypts or decrypts the data using RSA algorithm
cipher/rsa/rsa2.go:108
↓ 2 callersFunctionequal
(a, b float64)
search/ternary_test.go:10
↓ 2 callersFunctionflip
flip reverses the input slice from `0` to `i`.
sort/pancakesort.go:38
↓ 2 callersMethodfrontQueue
frontQueue it will return the front data
structure/queue/queuelinkedlist.go:70
↓ 2 callersFunctiongetKey
(keyWord string)
cipher/transposition/transposition.go:24
↓ 2 callersFunctiongetLCSTestCases
()
dynamic/longestcommonsubsequence_test.go:15
↓ 2 callersMethodgetNodeByKey
getNodeByKey finds the node associated with the given key
structure/hashmap/hashmap.go:80
↓ 2 callersFunctiongetTestCases
()
math/min/min_test.go:7
↓ 2 callersFunctiongetTests
()
math/binary/arithmeticmean_test.go:35
↓ 2 callersMethodhash
hash generates a hash value for the given key
structure/hashmap/hashmap.go:107
↓ 2 callersMethodheapifyUp
(i int)
sort/heapsort.go:84
↓ 2 callersFunctionhexToBinary
hexToBinary() function that will take Hexadecimal number as string, and return its Binary equivalent as a string.
conversion/hexadecimaltobinary.go:24
↓ 2 callersFunctionhexToDecimal
hexToDecimal converts a hexadecimal string to a decimal integer.
conversion/hexadecimaltodecimal.go:23
↓ 2 callersMethodincreaseFreq
increaseFreq increase the frequency if element
cache/lfu.go:92
↓ 2 callersMethodinsertMap
insertMap insert item in map
cache/lfu.go:107
↓ 2 callersMethodinsertValue
(val T, at *Node[T])
structure/linkedlist/doubly.go:51
↓ 2 callersFunctionisTrivial
isTrivial checks if num's primality is easy to determine. If it is, it returns true and num's primality. Otherwise it returns false and false.
math/prime/millerrabintest.go:33
↓ 2 callersFunctionkthNumber
kthNumber use the selection algorithm (based on the partition method - the same one as used in quicksort).
math/kthnumber.go:25
↓ 2 callersMethodlazyInit
lazyInit lazily initializes a zero List value.
structure/linkedlist/doubly.go:36
↓ 2 callersFunctionleast
least removes the node with lowest weight from q1, q2. It returns the node with lowest weight and the slices q1, q2 after the update.
compression/huffmancoding.go:61
↓ 2 callersFunctionlongestIncreasingSubsequenceTest
(t *testing.T, algorithm func(nums []int) int)
dynamic/longestincreasingsubsequence_test.go:10
↓ 2 callersFunctionlpsTestTemplate
(t *testing.T, algorithm func(input string) int)
dynamic/longestpalindromicsubsequence_test.go:10
↓ 2 callersFunctionminKeys
(maxKeys int)
structure/tree/btree.go:20
↓ 2 callersFunctionretCases
()
math/krishnamurthy_test.go:8
↓ 2 callersFunctionsortSlices
Utility function to sort the slices and their contents
graph/kosaraju_test.go:96
↓ 2 callersFunctionsplitInt
splitInt takes an integer x and splits it within an integer slice of length n in the most uniform way possible. For example, splitInt(10, 3) will retu
math/pi/montecarlopi.go:76
↓ 2 callersFunctionstrToRuneSlice
(s string)
dynamic/longestcommonsubsequence.go:10
↓ 2 callersFunctiontable
table building for kmp algorithm.
strings/kmp/kmp.go:36
↓ 2 callersFunctiontestFunc
(t *testing.T, tests []testStruct[T], less func(a, b T) bool)
structure/heap/heap_test.go:115
↓ 2 callersFunctiontestModeFramework
(t *testing.T, testCases []testCase[T])
math/mode_test.go:22
↓ 2 callersFunctiontestPrecondition
(t *testing.T)
cipher/rsa/rsa_test.go:38
↓ 2 callersFunctionunsignedRadixSort
(arr []T)
sort/radixsort.go:35
↓ 1 callersFunctionAbbreviation
Returns true if it is possible to make a equals b (if b is an abbreviation of a), returns false otherwise
dynamic/abbreviation.go:26
↓ 1 callersMethodAdd
(value T)
structure/set/set.go:57
↓ 1 callersMethodAdd
Add Adds value to the element at position pos of the array and recomputes the range sums.
structure/fenwicktree/fenwicktree.go:56
↓ 1 callersFunctionArticulationPoint
ArticulationPoint identifies articulation points in a graph. It returns a boolean slice where each element indicates whether a vertex is an articulati
graph/articulationpoints.go:20
↓ 1 callersMethodBFSInsert
(value NodeValue)
project_euler/problem_18/tree.go:14
↓ 1 callersMethodBack
Back it will return the back value
structure/queue/queuelinklistwithlist.go:53
↓ 1 callersMethodBellmanFord
(start, end int)
graph/bellmanford.go:16
↓ 1 callersFunctionBin2
func main() { myArrayOfK := [4]int{5, 6, 7, 8} var x int fmt.Println("\nBinomial Coefficient Using Dynamic Programming:", bin2(50, 5)) for _, elem
dynamic/binomialcoefficient.go:26
↓ 1 callersFunctionBipartiteCheck
basically tries to color the graph in two colors if each edge connects 2 differently colored nodes the graph can be considered bipartite
graph/coloring/bipartite.go:46
↓ 1 callersFunctionBitCounter
BitCounter - The function returns the number of set bits for an unsigned integer number
math/binary/bitcounter.go:13
↓ 1 callersFunctionBoolArrayCapUp
BoolArrayCapUp Dynamically increases an array size of bool's by 1.
strings/ahocorasick/shared.go:78
↓ 1 callersFunctionBoyerMoore
Implementation of boyer moore string search O(l) where l=len(text)
strings/search/boyermoore.go:5
↓ 1 callersFunctionBreadthFirstSearch
BreadthFirstSearch is an algorithm for traversing and searching graph data structures. It starts at an arbitrary node of a graph, and explores all of
graph/breadthfirstsearch.go:9
↓ 1 callersFunctionBubble
Bubble is a simple generic definition of Bubble sort algorithm.
sort/bubblesort.go:9
↓ 1 callersMethodBuild
Build builds the SegmentTree by computing the sum of different ranges. node, leftNode and rightNode should always start with 1, 0 and len(Array)-1, re
structure/segmenttree/segmenttree.go:100
↓ 1 callersFunctionBuildAc
Functions that builds Aho Corasick automaton.
strings/ahocorasick/ahocorasick.go:54
↓ 1 callersFunctionBuildExtendedAc
BuildExtendedAc Functions that builds extended Aho Corasick automaton.
strings/ahocorasick/advancedahocorasick.go:46
↓ 1 callersMethodCheckRangeFromIndex
(left, right int)
structure/linkedlist/singlylinkedlist.go:163
↓ 1 callersFunctionCoinChange
CoinChange finds the number of possible combinations of coins of different values which can get to the target amount.
dynamic/coinchange.go:11
↓ 1 callersMethodColorUsingBFS
ColorUsingBFS will return the Color of each vertex and the total number of different colors used, using BFS
graph/coloring/bfs.go:12
↓ 1 callersMethodColorUsingBacktracking
ColorUsingBacktracking will return the Color of each vertex and the total number of different colors used, using backtracking
graph/coloring/backtracking.go:10
↓ 1 callersMethodColorUsingGreedyApproach
ColorUsingGreedyApproach will return the Color of each vertex and the total number of different colors used, using a greedy approach, based on the num
graph/coloring/greedy.go:13
↓ 1 callersMethodCombine
Combine ...
strings/combination/combination.go:22
↓ 1 callersFunctionComputeAlphabet
ComputeAlphabet Function that returns string of all the possible characters in given patterns.
strings/ahocorasick/shared.go:61
↓ 1 callersFunctionContains
Contains Returns 'true' if array of int's 's' contains int 'e', 'false' otherwise.
strings/ahocorasick/shared.go:39
↓ 1 callersFunctionCos
Cos returns the cosine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine) [Based on the idea of Bhaskara approximati
math/cos.go:10
↓ 1 callersMethodCount
Count returns the current size of the list.
structure/linkedlist/singlylinkedlist.go:122
← previousnext →301–400 of 1,378, ranked by callers