MCPcopy Create free account

hub / github.com/TheAlgorithms/Go / functions

Functions1,378 in github.com/TheAlgorithms/Go

↓ 5 callersMethodPeek
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 callersFunctionSlope
Slope calculates the slope (gradient) of a line.
math/geometry/straightlines.go:32
↓ 5 callersMethodSplit
Transform: A B | a b c d Into: A c B / \ a b d
structure/tree/btree.go:128
↓ 5 callersFunctionStateExists
StateExists Checks if state 'state' exists. Returns 'true' if it does, 'false' otherwise.
strings/ahocorasick/shared.go:133
↓ 5 callersFunctiongetTestGraphs
()
graph/coloring/graph_test.go:18
↓ 5 callersMethodisEmpty
isEmpty it will check our list is empty or not
structure/queue/queuelinkedlist.go:60
↓ 5 callersMethodleftRotate
(x *RBNode[T])
structure/tree/rbtree.go:216
↓ 5 callersMethodrightRotate
(x *RBNode[T])
structure/tree/rbtree.go:237
↓ 4 callersMethodAddVertex
AddVertex will add a new vertex in the graph, if the vertex already exist it will do nothing
graph/coloring/graph.go:21
↓ 4 callersFunctionBase64Decode
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 callersFunctionBase64Encode
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 callersMethodCompact
Compact will remove unecessay nodes, reducing the capacity, returning true if node n itself should be removed.
structure/trie/trie.go:99
↓ 4 callersFunctionDecrypt
(text []rune, keyWord string)
cipher/transposition/transposition.go:83
↓ 4 callersFunctionEncrypt
(text []rune, keyWord string)
cipher/transposition/transposition.go:53
↓ 4 callersMethodFront
()
structure/linkedlist/doubly.go:190
↓ 4 callersMethodGetData
GetData function return all value of array
structure/dynamicarray/dynamicarray.go:83
↓ 4 callersMethodGetDepth
(u int)
graph/lowestcommonancestor.go:53
↓ 4 callersMethodGetItems
()
structure/set/set.go:65
↓ 4 callersFunctionIntArrayCapUp
IntArrayCapUp Dynamically increases an array size of int's by 1.
strings/ahocorasick/shared.go:70
↓ 4 callersFunctionIntToRoman
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 callersFunctionIsEmptyQueue
IsEmptyQueue check our list is empty or not
structure/queue/queuearray.go:42
↓ 4 callersMethodIsSubsetOf
IsSubsetOf: checks whether set is subset of set2 or not.
structure/set/set.go:30
↓ 4 callersMethodLeftIsNil
()
project_euler/problem_18/problem18.go:40
↓ 4 callersMethodLen
()
structure/set/set.go:73
↓ 4 callersFunctionLenQueue
LenQueue will return the length of the queue list
structure/queue/queuearray.go:37
↓ 4 callersFunctionNew
New creates a new DSA instance
cipher/dsa/dsa.go:36
↓ 4 callersFunctionNew
Constructor functions for graphs (undirected by default)
graph/graph.go:16
↓ 4 callersFunctionNewNode
Create new node.
structure/linkedlist/shared.go:12
↓ 4 callersFunctionOptimizedTrialDivision
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 callersMethodParent
()
structure/tree/tree.go:17
↓ 4 callersMethodPeek
peak return last input value
structure/stack/stacklinkedlist.go:59
↓ 4 callersMethodPop
Pop is return last value that insert into our stack also it will remove it in our stack
structure/stack/stacklinkedlistwithlist.go:38
↓ 4 callersMethodPush
Push add a value into our stack
structure/stack/stacklinkedlistwithlist.go:23
↓ 4 callersFunctionRomanToInt
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 callersFunctionSieveEratosthenes
(limit int)
math/prime/sieve2.go:9
↓ 4 callersMethodSize
Size returns the size of the heap
structure/heap/heap.go:64
↓ 4 callersMethodSize
Size returns the number of words in the Trie
structure/trie/trie.go:64
↓ 4 callersFunctionSpigot
(n int)
math/pi/spigotpi.go:14
↓ 4 callersMethodbalanceFactor
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 callersFunctionconvertToString
(res Result)
strings/ahocorasick/ahocorasick_test.go:24
↓ 4 callersFunctiongetRandomString
()
cipher/transposition/transposition_test.go:25
↓ 4 callersFunctiongetTests
()
math/fibonacci/fibonacci_test.go:8
↓ 4 callersMethodlen
len is return the length of queue
structure/queue/queuelinkedlist.go:65
↓ 4 callersFunctionmerge
(a []T, b []T)
sort/mergesort.go:15
↓ 4 callersFunctionprimalityTestBenchmarkHelper
(b *testing.B, f primalityTest)
math/prime/prime_test.go:33
↓ 4 callersFunctionprimalityTestTestingHelper
(t *testing.T, name string, f primalityTest)
math/prime/prime_test.go:13
↓ 4 callersMethodtransplant
(u, v *BSNode[T])
structure/tree/bstree.go:215
↓ 4 callersMethodtransplant
(u, v *RBNode[T])
structure/tree/rbtree.go:413
↓ 4 callersMethodupdateidx
(i int)
sort/heapsort.go:70
↓ 3 callersFunctionAbs
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 callersMethodAddAtEnd
AddAtEnd Add a node at the end of the linkedlist
structure/linkedlist/doubly.go:62
↓ 3 callersFunctionCRC8
CRC8 calculates CRC8 checksum of the given data.
checksum/crc8.go:27
↓ 3 callersMethodCheckRangeFromIndex
CheckRangeFromIndex function it will check the range from the index
structure/dynamicarray/dynamicarray.go:88
↓ 3 callersFunctionCreateTransition
CreateTransition Creates a transition for function σ(state,letter) = end.
strings/ahocorasick/shared.go:116
↓ 3 callersFunctionDecrypt
Decrypt decrypts by left shift of "key" each character of "input"
cipher/caesar/caesar.go:31
↓ 3 callersFunctionDecrypt
Decrypt decrypts with Xor encryption
cipher/xor/xor.go:23
↓ 3 callersMethodDecrypt
Decrypt decrypts with polybius encryption
cipher/polybius/polybius.go:65
↓ 3 callersMethodDelAtBeg
DelAtBeg Delete the node at the beginning of the linkedlist
structure/linkedlist/doubly.go:77
↓ 3 callersMethodDelAtEnd
DetAtEnd Delete a node at the end of the linkedlist
structure/linkedlist/doubly.go:91
↓ 3 callersMethodDelete
Delete: deletes the passed element from the set if present
structure/set/set.go:22
↓ 3 callersMethodDeleteIthKey
(i int)
structure/tree/btree.go:196
↓ 3 callersFunctionEncrypt
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 callersMethodEncrypt
Encrypt encrypts with polybius encryption
cipher/polybius/polybius.go:52
↓ 3 callersMethodEncryptString
EncryptString encrypts the data using RSA algorithm returns the encrypted string
cipher/rsa/rsa2.go:63
↓ 3 callersFunctionFactorize
Factorize is a function that computes the exponents of each prime in the prime factorization of n
math/prime/primefactorization.go:10
↓ 3 callersMethodGetParameters
GetParameters returns the DSA parameters (p, q, g)
cipher/dsa/dsa.go:189
↓ 3 callersMethodGetPrivateKey
GetPrivateKey returns the private Key (x)
cipher/dsa/dsa.go:194
↓ 3 callersFunctionInverse
Inverse Modular function
math/modular/inverse.go:21
↓ 3 callersMethodIsFull
(maxKeys int)
structure/tree/btree.go:54
↓ 3 callersMethodIsFull
IsFull checks if the queue is full.
structure/circularqueue/circularqueuearray.go:73
↓ 3 callersMethodIsSupersetOf
IsSupersetOf: checks whether set is superset of set2 or not.
structure/set/set.go:35
↓ 3 callersFunctionLcm
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 callersMethodLevelOrder
()
structure/tree/example_test.go:25
↓ 3 callersMethodMerge
Transform: A B C / \ a b Into: A C | a B c
structure/tree/btree.go:219
↓ 3 callersFunctionMillerTest
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 callersFunctionNew
New initializes the RSA algorithm returns the RSA object
cipher/rsa/rsa2.go:32
↓ 3 callersFunctionNthFibonacci
https://www.geeksforgeeks.org/program-for-nth-fibonacci-number/ NthFibonacci returns the nth Fibonacci Number
dynamic/fibonacci.go:10
↓ 3 callersMethodPostOrder
()
structure/tree/example_test.go:24
↓ 3 callersMethodPreOrder
()
structure/tree/example_test.go:22
↓ 3 callersMethodPrefixSum
PrefixSum returns the sum of the prefix ending at position pos.
structure/fenwicktree/fenwicktree.go:37
↓ 3 callersMethodPropagate
Propagate propagates the lazy updates to the child nodes
structure/segmenttree/segmenttree.go:24
↓ 3 callersMethodRightIsNil
()
project_euler/problem_18/problem18.go:41
↓ 3 callersMethodRotate
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 callersMethodSetParent
(Node)
project_euler/problem_18/problem18.go:44
↓ 3 callersFunctionSign
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 callersMethodSize
Size returns the size of the queue.
structure/circularqueue/circularqueuearray.go:94
↓ 3 callersMethodStrassenMatrixMultiply
Perform matrix multiplication using Strassen's algorithm
math/matrix/strassenmatrixmultiply.go:14
↓ 3 callersFunctionSumOfProperDivisors
Returns the sum of proper divisors of inNumber.
math/perfectnumber.go:19
↓ 3 callersFunctionfactorial
(n int)
math/catalan/catalannumber.go:17
↓ 3 callersFunctiongetTestsForPowerOfTwo
()
math/binary/checkisnumberpoweroftwo_test.go:14
↓ 3 callersFunctionheapifyDown
(slice []T, N, i int, moreFunc func(i, j int) bool, swapFunc func(i, j int))
sort/heapsort.go:100
↓ 3 callersMethodheapifyDown
(i int)
sort/heapsort.go:96
↓ 3 callersFunctionleftRotate
leftRotate rotates x left by n bits
hashing/sha1/sha1.go:38
↓ 3 callersFunctionmodularExponentiation
r = (b^e)%mod
cipher/diffiehellman/diffiehellmankeyexchange.go:28
↓ 3 callersFunctionrot13
rot13 is a special case, which is fixed the shift of 13, of the Caesar cipher
cipher/rot13/rot13.go:14
↓ 3 callersMethodswap
(i, j int)
structure/heap/heap.go:68
↓ 2 callersFunctionAbs
Abs returns absolute value
math/abs.go:11
↓ 2 callersMethodAddVertex
AddVertex will add a new vertex in the graph. If the vertex already exists it will do nothing.
graph/graph.go:24
↓ 2 callersFunctionAhoCorasick
AhoCorasick Function performing the Basic Aho-Corasick algorithm. Finds and prints occurrences of each pattern.
strings/ahocorasick/ahocorasick.go:15
↓ 2 callersFunctionAliquotSum
This function returns s(n) for given number
math/aliquotsum.go:16
← previousnext →101–200 of 1,378, ranked by callers