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
↓ 5 callers
Method
Peek
Peek returns the item at the front of the queue without removing it. Returns an error if the queue is empty.
structure/circularqueue/circularqueuearray.go:84
↓ 5 callers
Function
Slope
Slope calculates the slope (gradient) of a line.
math/geometry/straightlines.go:32
↓ 5 callers
Method
Split
Transform: A B | a b c d Into: A c B / \ a b d
structure/tree/btree.go:128
↓ 5 callers
Function
StateExists
StateExists Checks if state 'state' exists. Returns 'true' if it does, 'false' otherwise.
strings/ahocorasick/shared.go:133
↓ 5 callers
Function
getTestGraphs
()
graph/coloring/graph_test.go:18
↓ 5 callers
Method
isEmpty
isEmpty it will check our list is empty or not
structure/queue/queuelinkedlist.go:60
↓ 5 callers
Method
leftRotate
(x *RBNode[T])
structure/tree/rbtree.go:216
↓ 5 callers
Method
rightRotate
(x *RBNode[T])
structure/tree/rbtree.go:237
↓ 4 callers
Method
AddVertex
AddVertex will add a new vertex in the graph, if the vertex already exist it will do nothing
graph/coloring/graph.go:21
↓ 4 callers
Function
Base64Decode
Base64Decode decodes the received input base64 string into a byte slice. The implementation follows the RFC4648 standard, which is documented at https
conversion/base64.go:59
↓ 4 callers
Function
Base64Encode
Base64Encode encodes the received input bytes slice into a base64 string. The implementation follows the RFC4648 standard, which is documented at http
conversion/base64.go:21
↓ 4 callers
Method
Compact
Compact will remove unecessay nodes, reducing the capacity, returning true if node n itself should be removed.
structure/trie/trie.go:99
↓ 4 callers
Function
Decrypt
(text []rune, keyWord string)
cipher/transposition/transposition.go:83
↓ 4 callers
Function
Encrypt
(text []rune, keyWord string)
cipher/transposition/transposition.go:53
↓ 4 callers
Method
Front
()
structure/linkedlist/doubly.go:190
↓ 4 callers
Method
GetData
GetData function return all value of array
structure/dynamicarray/dynamicarray.go:83
↓ 4 callers
Method
GetDepth
(u int)
graph/lowestcommonancestor.go:53
↓ 4 callers
Method
GetItems
()
structure/set/set.go:65
↓ 4 callers
Function
IntArrayCapUp
IntArrayCapUp Dynamically increases an array size of int's by 1.
strings/ahocorasick/shared.go:70
↓ 4 callers
Function
IntToRoman
IntToRoman converts an integer value to a roman numeral string. An error is returned if the integer is not between 1 and 3999.
conversion/inttoroman.go:23
↓ 4 callers
Function
IsEmptyQueue
IsEmptyQueue check our list is empty or not
structure/queue/queuearray.go:42
↓ 4 callers
Method
IsSubsetOf
IsSubsetOf: checks whether set is subset of set2 or not.
structure/set/set.go:30
↓ 4 callers
Method
LeftIsNil
()
project_euler/problem_18/problem18.go:40
↓ 4 callers
Method
Len
()
structure/set/set.go:73
↓ 4 callers
Function
LenQueue
LenQueue will return the length of the queue list
structure/queue/queuearray.go:37
↓ 4 callers
Function
New
New creates a new DSA instance
cipher/dsa/dsa.go:36
↓ 4 callers
Function
New
Constructor functions for graphs (undirected by default)
graph/graph.go:16
↓ 4 callers
Function
NewNode
Create new node.
structure/linkedlist/shared.go:12
↓ 4 callers
Function
OptimizedTrialDivision
OptimizedTrialDivision checks primality of an integer using an optimized trial division method. The optimizations include not checking divisibility by
math/prime/primecheck.go:28
↓ 4 callers
Method
Parent
()
structure/tree/tree.go:17
↓ 4 callers
Method
Peek
peak return last input value
structure/stack/stacklinkedlist.go:59
↓ 4 callers
Method
Pop
Pop is return last value that insert into our stack also it will remove it in our stack
structure/stack/stacklinkedlistwithlist.go:38
↓ 4 callers
Method
Push
Push add a value into our stack
structure/stack/stacklinkedlistwithlist.go:23
↓ 4 callers
Function
RomanToInt
RomanToInt converts a roman numeral string to an integer. Roman numerals for numbers outside the range 1 to 3,999 will return an error. Nil or empty s
conversion/romantoint.go:42
↓ 4 callers
Function
SieveEratosthenes
(limit int)
math/prime/sieve2.go:9
↓ 4 callers
Method
Size
Size returns the size of the heap
structure/heap/heap.go:64
↓ 4 callers
Method
Size
Size returns the number of words in the Trie
structure/trie/trie.go:64
↓ 4 callers
Function
Spigot
(n int)
math/pi/spigotpi.go:14
↓ 4 callers
Method
balanceFactor
balanceFactor : negative balance factor means subtree Root is heavy toward Left and positive balance factor means subtree Root is heavy toward Right s
structure/tree/avl.go:312
↓ 4 callers
Function
convertToString
(res Result)
strings/ahocorasick/ahocorasick_test.go:24
↓ 4 callers
Function
getRandomString
()
cipher/transposition/transposition_test.go:25
↓ 4 callers
Function
getTests
()
math/fibonacci/fibonacci_test.go:8
↓ 4 callers
Method
len
len is return the length of queue
structure/queue/queuelinkedlist.go:65
↓ 4 callers
Function
merge
(a []T, b []T)
sort/mergesort.go:15
↓ 4 callers
Function
primalityTestBenchmarkHelper
(b *testing.B, f primalityTest)
math/prime/prime_test.go:33
↓ 4 callers
Function
primalityTestTestingHelper
(t *testing.T, name string, f primalityTest)
math/prime/prime_test.go:13
↓ 4 callers
Method
transplant
(u, v *BSNode[T])
structure/tree/bstree.go:215
↓ 4 callers
Method
transplant
(u, v *RBNode[T])
structure/tree/rbtree.go:413
↓ 4 callers
Method
updateidx
(i int)
sort/heapsort.go:70
↓ 3 callers
Function
Abs
Abs returns absolute value using binary operation Principle of operation: 1) Get the mask by right shift by the base 2) Base is the size of an integer
math/binary/abs.go:15
↓ 3 callers
Method
AddAtEnd
AddAtEnd Add a node at the end of the linkedlist
structure/linkedlist/doubly.go:62
↓ 3 callers
Function
CRC8
CRC8 calculates CRC8 checksum of the given data.
checksum/crc8.go:27
↓ 3 callers
Method
CheckRangeFromIndex
CheckRangeFromIndex function it will check the range from the index
structure/dynamicarray/dynamicarray.go:88
↓ 3 callers
Function
CreateTransition
CreateTransition Creates a transition for function σ(state,letter) = end.
strings/ahocorasick/shared.go:116
↓ 3 callers
Function
Decrypt
Decrypt decrypts by left shift of "key" each character of "input"
cipher/caesar/caesar.go:31
↓ 3 callers
Function
Decrypt
Decrypt decrypts with Xor encryption
cipher/xor/xor.go:23
↓ 3 callers
Method
Decrypt
Decrypt decrypts with polybius encryption
cipher/polybius/polybius.go:65
↓ 3 callers
Method
DelAtBeg
DelAtBeg Delete the node at the beginning of the linkedlist
structure/linkedlist/doubly.go:77
↓ 3 callers
Method
DelAtEnd
DetAtEnd Delete a node at the end of the linkedlist
structure/linkedlist/doubly.go:91
↓ 3 callers
Method
Delete
Delete: deletes the passed element from the set if present
structure/set/set.go:22
↓ 3 callers
Method
DeleteIthKey
(i int)
structure/tree/btree.go:196
↓ 3 callers
Function
Encrypt
Encrypt encrypts with Xor encryption after converting each character to byte The returned value might not be readable because there is no guarantee wh
cipher/xor/xor.go:14
↓ 3 callers
Method
Encrypt
Encrypt encrypts with polybius encryption
cipher/polybius/polybius.go:52
↓ 3 callers
Method
EncryptString
EncryptString encrypts the data using RSA algorithm returns the encrypted string
cipher/rsa/rsa2.go:63
↓ 3 callers
Function
Factorize
Factorize is a function that computes the exponents of each prime in the prime factorization of n
math/prime/primefactorization.go:10
↓ 3 callers
Method
GetParameters
GetParameters returns the DSA parameters (p, q, g)
cipher/dsa/dsa.go:189
↓ 3 callers
Method
GetPrivateKey
GetPrivateKey returns the private Key (x)
cipher/dsa/dsa.go:194
↓ 3 callers
Function
Inverse
Inverse Modular function
math/modular/inverse.go:21
↓ 3 callers
Method
IsFull
(maxKeys int)
structure/tree/btree.go:54
↓ 3 callers
Method
IsFull
IsFull checks if the queue is full.
structure/circularqueue/circularqueuearray.go:73
↓ 3 callers
Method
IsSupersetOf
IsSupersetOf: checks whether set is superset of set2 or not.
structure/set/set.go:35
↓ 3 callers
Function
Lcm
Lcm returns the lcm of two numbers using the fact that lcm(a,b) * gcd(a,b) = | a * b |
math/lcm/lcm.go:10
↓ 3 callers
Method
LevelOrder
()
structure/tree/example_test.go:25
↓ 3 callers
Method
Merge
Transform: A B C / \ a b Into: A C | a B c
structure/tree/btree.go:219
↓ 3 callers
Function
MillerTest
MillerTest tests whether num is a strong probable prime to a witness. Formally: a^d ≡ 1 (mod n) or a^(2^r * d) ≡ -1 (mod n), 0 <= r <= s
math/prime/millerrabintest.go:50
↓ 3 callers
Function
New
New initializes the RSA algorithm returns the RSA object
cipher/rsa/rsa2.go:32
↓ 3 callers
Function
NthFibonacci
https://www.geeksforgeeks.org/program-for-nth-fibonacci-number/ NthFibonacci returns the nth Fibonacci Number
dynamic/fibonacci.go:10
↓ 3 callers
Method
PostOrder
()
structure/tree/example_test.go:24
↓ 3 callers
Method
PreOrder
()
structure/tree/example_test.go:22
↓ 3 callers
Method
PrefixSum
PrefixSum returns the sum of the prefix ending at position pos.
structure/fenwicktree/fenwicktree.go:37
↓ 3 callers
Method
Propagate
Propagate propagates the lazy updates to the child nodes
structure/segmenttree/segmenttree.go:24
↓ 3 callers
Method
RightIsNil
()
project_euler/problem_18/problem18.go:41
↓ 3 callers
Method
Rotate
Rotate list by P places. This method is interesting for optimization. For first optimization we must decrease P value so that it ranges from 0 to N-1.
structure/linkedlist/cyclic.go:49
↓ 3 callers
Method
SetParent
(Node)
project_euler/problem_18/problem18.go:44
↓ 3 callers
Function
Sign
Sign is signature generation for DSA 1. Choose a random integer k from the range [1, q-1] 2. Compute r = (g^k mod p) mod q 3. Compute s = (k^-1 * (H(m
cipher/dsa/dsa.go:125
↓ 3 callers
Method
Size
Size returns the size of the queue.
structure/circularqueue/circularqueuearray.go:94
↓ 3 callers
Method
StrassenMatrixMultiply
Perform matrix multiplication using Strassen's algorithm
math/matrix/strassenmatrixmultiply.go:14
↓ 3 callers
Function
SumOfProperDivisors
Returns the sum of proper divisors of inNumber.
math/perfectnumber.go:19
↓ 3 callers
Function
factorial
(n int)
math/catalan/catalannumber.go:17
↓ 3 callers
Function
getTestsForPowerOfTwo
()
math/binary/checkisnumberpoweroftwo_test.go:14
↓ 3 callers
Function
heapifyDown
(slice []T, N, i int, moreFunc func(i, j int) bool, swapFunc func(i, j int))
sort/heapsort.go:100
↓ 3 callers
Method
heapifyDown
(i int)
sort/heapsort.go:96
↓ 3 callers
Function
leftRotate
leftRotate rotates x left by n bits
hashing/sha1/sha1.go:38
↓ 3 callers
Function
modularExponentiation
r = (b^e)%mod
cipher/diffiehellman/diffiehellmankeyexchange.go:28
↓ 3 callers
Function
rot13
rot13 is a special case, which is fixed the shift of 13, of the Caesar cipher
cipher/rot13/rot13.go:14
↓ 3 callers
Method
swap
(i, j int)
structure/heap/heap.go:68
↓ 2 callers
Function
Abs
Abs returns absolute value
math/abs.go:11
↓ 2 callers
Method
AddVertex
AddVertex will add a new vertex in the graph. If the vertex already exists it will do nothing.
graph/graph.go:24
↓ 2 callers
Function
AhoCorasick
AhoCorasick Function performing the Basic Aho-Corasick algorithm. Finds and prints occurrences of each pattern.
strings/ahocorasick/ahocorasick.go:15
↓ 2 callers
Function
AliquotSum
This function returns s(n) for given number
math/aliquotsum.go:16
← previous
next →
101–200 of 1,378, ranked by callers