Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Go
/ functions
Functions
1,378 in github.com/TheAlgorithms/Go
⨍
Functions
1,378
◇
Types & classes
127
↓ 2 callers
Function
Problem3
(n uint)
project_euler/problem_3/problem3.go:12
↓ 2 callers
Function
Problem4
()
project_euler/problem_4/problem4.go:19
↓ 2 callers
Function
Problem5
(limit uint)
project_euler/problem_5/problem5.go:13
↓ 2 callers
Function
Problem6
(n uint)
project_euler/problem_6/problem6.go:21
↓ 2 callers
Function
Problem7
(n uint)
project_euler/problem_7/problem7.go:16
↓ 2 callers
Function
Problem8
(window int)
project_euler/problem_8/problem8.go:16
↓ 2 callers
Function
Problem9
()
project_euler/problem_9/problem9.go:17
↓ 2 callers
Function
PronicNumber
PronicNumber returns true if argument passed to the function is pronic and false otherwise.
math/pronicnumber.go:17
↓ 2 callers
Method
Push
(i Comparable)
sort/heapsort.go:53
↓ 2 callers
Function
RGBToHEX
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 callers
Function
RLEdecode
RLEdecode takes a run-length encoded string and returns the original string
compression/rlecoding.go:37
↓ 2 callers
Function
RLEdecodebytes
RLEdecodebytes takes a run-length encoded byte slice and returns the original byte slice
compression/rlecoding.go:67
↓ 2 callers
Function
RLEncode
RLEncode takes a string and returns its run-length encoding
compression/rlecoding.go:22
↓ 2 callers
Function
RLEncodebytes
RLEncodebytes takes a byte slice and returns its run-length encoding as a byte slice
compression/rlecoding.go:50
↓ 2 callers
Method
Rear
Rear gets the last item from queue.
structure/deque/deque.go:68
↓ 2 callers
Function
Recursive
Recursive finds and returns the greatest common divisor of a given integer.
math/gcd/gcd.go:7
↓ 2 callers
Function
RecursivePower
RecursivePower is recursive O(logn) function for pow(x, y)
math/power/fastexponent.go:18
↓ 2 callers
Function
RecursivePower1
RecursivePower1 is recursive O(n) function for pow(x, y)
math/power/fastexponent.go:30
↓ 2 callers
Method
Remove
(n *Node[T])
structure/linkedlist/doubly.go:67
↓ 2 callers
Method
Reverse
Reverse Reverse the order of the linkedlist
structure/linkedlist/doubly.go:153
↓ 2 callers
Function
ReverseBits
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 callers
Function
SelectK
(array []int, k int)
search/selectk.go:3
↓ 2 callers
Function
SequenceGrayCode
SequenceGrayCode The function generates an "Gray code" sequence of length n
math/binary/rbc.go:13
↓ 2 callers
Function
Sieve
Sieve Sieving the numbers that are not prime from the channel - basically removing them from the channels
math/prime/sieve.go:16
↓ 2 callers
Function
Sqrt
(n float32)
math/binary/sqrt.go:12
↓ 2 callers
Function
TemplateBenchmarkExtendedGCD
(b *testing.B, f testExtendedFunction)
math/gcd/extendedgcd_test.go:44
↓ 2 callers
Function
TemplateBenchmarkGCD
(b *testing.B, f testFunction)
math/gcd/gcd_test.go:37
↓ 2 callers
Function
TemplateTestExtendedGCD
(t *testing.T, f testExtendedFunction)
math/gcd/extendedgcd_test.go:7
↓ 2 callers
Function
TemplateTestGCD
(t *testing.T, f testFunction)
math/gcd/gcd_test.go:18
↓ 2 callers
Function
Twin
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 callers
Function
UpperBound
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 callers
Function
UsingLog
(a float64, b float64)
math/power/powvialogarithm.go:16
↓ 2 callers
Function
Verify
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 callers
Method
Verify
(tree *BTree[T])
structure/tree/btree.go:45
↓ 2 callers
Function
XorSearchMissingNumber
XorSearchMissingNumber This function finds a missing number in a sequence
math/binary/xorsearch.go:13
↓ 2 callers
Function
almostEqual
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 callers
Function
assertRot13Output
(t *testing.T, input, expected string)
cipher/rot13/rot13_test.go:64
↓ 2 callers
Method
backQueue
backQueue it will return the back data
structure/queue/queuelinkedlist.go:75
↓ 2 callers
Function
cleanString
(text string)
strings/palindrome/ispalindrome.go:19
↓ 2 callers
Function
cutRodSolTestFunc
(t *testing.T, cutRodSolFunc func([]int, int) int)
dynamic/rodcutting_test.go:24
↓ 2 callers
Method
dfs
(int, int)
graph/lowestcommonancestor.go:20
↓ 2 callers
Function
encryptDecryptInt
encryptDecryptInt encrypts or decrypts the data using RSA algorithm
cipher/rsa/rsa2.go:108
↓ 2 callers
Function
equal
(a, b float64)
search/ternary_test.go:10
↓ 2 callers
Function
flip
flip reverses the input slice from `0` to `i`.
sort/pancakesort.go:38
↓ 2 callers
Method
frontQueue
frontQueue it will return the front data
structure/queue/queuelinkedlist.go:70
↓ 2 callers
Function
getKey
(keyWord string)
cipher/transposition/transposition.go:24
↓ 2 callers
Function
getLCSTestCases
()
dynamic/longestcommonsubsequence_test.go:15
↓ 2 callers
Method
getNodeByKey
getNodeByKey finds the node associated with the given key
structure/hashmap/hashmap.go:80
↓ 2 callers
Function
getTestCases
()
math/min/min_test.go:7
↓ 2 callers
Function
getTests
()
math/binary/arithmeticmean_test.go:35
↓ 2 callers
Method
hash
hash generates a hash value for the given key
structure/hashmap/hashmap.go:107
↓ 2 callers
Method
heapifyUp
(i int)
sort/heapsort.go:84
↓ 2 callers
Function
hexToBinary
hexToBinary() function that will take Hexadecimal number as string, and return its Binary equivalent as a string.
conversion/hexadecimaltobinary.go:24
↓ 2 callers
Function
hexToDecimal
hexToDecimal converts a hexadecimal string to a decimal integer.
conversion/hexadecimaltodecimal.go:23
↓ 2 callers
Method
increaseFreq
increaseFreq increase the frequency if element
cache/lfu.go:92
↓ 2 callers
Method
insertMap
insertMap insert item in map
cache/lfu.go:107
↓ 2 callers
Method
insertValue
(val T, at *Node[T])
structure/linkedlist/doubly.go:51
↓ 2 callers
Function
isTrivial
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 callers
Function
kthNumber
kthNumber use the selection algorithm (based on the partition method - the same one as used in quicksort).
math/kthnumber.go:25
↓ 2 callers
Method
lazyInit
lazyInit lazily initializes a zero List value.
structure/linkedlist/doubly.go:36
↓ 2 callers
Function
least
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 callers
Function
longestIncreasingSubsequenceTest
(t *testing.T, algorithm func(nums []int) int)
dynamic/longestincreasingsubsequence_test.go:10
↓ 2 callers
Function
lpsTestTemplate
(t *testing.T, algorithm func(input string) int)
dynamic/longestpalindromicsubsequence_test.go:10
↓ 2 callers
Function
minKeys
(maxKeys int)
structure/tree/btree.go:20
↓ 2 callers
Function
retCases
()
math/krishnamurthy_test.go:8
↓ 2 callers
Function
sortSlices
Utility function to sort the slices and their contents
graph/kosaraju_test.go:96
↓ 2 callers
Function
splitInt
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 callers
Function
strToRuneSlice
(s string)
dynamic/longestcommonsubsequence.go:10
↓ 2 callers
Function
table
table building for kmp algorithm.
strings/kmp/kmp.go:36
↓ 2 callers
Function
testFunc
(t *testing.T, tests []testStruct[T], less func(a, b T) bool)
structure/heap/heap_test.go:115
↓ 2 callers
Function
testModeFramework
(t *testing.T, testCases []testCase[T])
math/mode_test.go:22
↓ 2 callers
Function
testPrecondition
(t *testing.T)
cipher/rsa/rsa_test.go:38
↓ 2 callers
Function
unsignedRadixSort
(arr []T)
sort/radixsort.go:35
↓ 1 callers
Function
Abbreviation
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 callers
Method
Add
(value T)
structure/set/set.go:57
↓ 1 callers
Method
Add
Add Adds value to the element at position pos of the array and recomputes the range sums.
structure/fenwicktree/fenwicktree.go:56
↓ 1 callers
Function
ArticulationPoint
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 callers
Method
BFSInsert
(value NodeValue)
project_euler/problem_18/tree.go:14
↓ 1 callers
Method
Back
Back it will return the back value
structure/queue/queuelinklistwithlist.go:53
↓ 1 callers
Method
BellmanFord
(start, end int)
graph/bellmanford.go:16
↓ 1 callers
Function
Bin2
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 callers
Function
BipartiteCheck
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 callers
Function
BitCounter
BitCounter - The function returns the number of set bits for an unsigned integer number
math/binary/bitcounter.go:13
↓ 1 callers
Function
BoolArrayCapUp
BoolArrayCapUp Dynamically increases an array size of bool's by 1.
strings/ahocorasick/shared.go:78
↓ 1 callers
Function
BoyerMoore
Implementation of boyer moore string search O(l) where l=len(text)
strings/search/boyermoore.go:5
↓ 1 callers
Function
BreadthFirstSearch
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 callers
Function
Bubble
Bubble is a simple generic definition of Bubble sort algorithm.
sort/bubblesort.go:9
↓ 1 callers
Method
Build
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 callers
Function
BuildAc
Functions that builds Aho Corasick automaton.
strings/ahocorasick/ahocorasick.go:54
↓ 1 callers
Function
BuildExtendedAc
BuildExtendedAc Functions that builds extended Aho Corasick automaton.
strings/ahocorasick/advancedahocorasick.go:46
↓ 1 callers
Method
CheckRangeFromIndex
(left, right int)
structure/linkedlist/singlylinkedlist.go:163
↓ 1 callers
Function
CoinChange
CoinChange finds the number of possible combinations of coins of different values which can get to the target amount.
dynamic/coinchange.go:11
↓ 1 callers
Method
ColorUsingBFS
ColorUsingBFS will return the Color of each vertex and the total number of different colors used, using BFS
graph/coloring/bfs.go:12
↓ 1 callers
Method
ColorUsingBacktracking
ColorUsingBacktracking will return the Color of each vertex and the total number of different colors used, using backtracking
graph/coloring/backtracking.go:10
↓ 1 callers
Method
ColorUsingGreedyApproach
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 callers
Method
Combine
Combine ...
strings/combination/combination.go:22
↓ 1 callers
Function
ComputeAlphabet
ComputeAlphabet Function that returns string of all the possible characters in given patterns.
strings/ahocorasick/shared.go:61
↓ 1 callers
Function
Contains
Contains Returns 'true' if array of int's 's' contains int 'e', 'false' otherwise.
strings/ahocorasick/shared.go:39
↓ 1 callers
Function
Cos
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 callers
Method
Count
Count returns the current size of the list.
structure/linkedlist/singlylinkedlist.go:122
← previous
next →
301–400 of 1,378, ranked by callers