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
Method
Append
(key T, child *BTreeNode[T])
structure/tree/btree.go:100
↓ 2 callers
Function
ArrayUnion
ArrayUnion Concats two arrays of int's into one.
strings/ahocorasick/shared.go:86
↓ 2 callers
Method
Back
()
structure/linkedlist/doubly.go:198
↓ 2 callers
Function
BackQueue
BackQueue return the Back value
structure/queue/queuearray.go:32
↓ 2 callers
Function
Binary
Binary search for target within a sorted array by repeatedly dividing the array in half and comparing the midpoint with the target. This function uses
search/binary.go:6
↓ 2 callers
Function
BinaryIterative
BinaryIterative search for target within a sorted array by repeatedly dividing the array in half and comparing the midpoint with the target. Unlike Bi
search/binary.go:23
↓ 2 callers
Function
BinaryToDecimal
BinaryToDecimal() function that will take Binary number as string, and return its Decimal equivalent as an integer.
conversion/binarytodecimal.go:27
↓ 2 callers
Function
Bitwise
Bitwise This function returns the minimum integer using bit operations
math/min/bitwisemin.go:11
↓ 2 callers
Function
CatalanNumber
CatalanNumber This function returns the `nth` Catalan number
math/catalan/catalannumber.go:26
↓ 2 callers
Function
Combinations
C is Binomial Coefficient function This function returns C(n, k) for given n and k
math/binomialcoefficient.go:22
↓ 2 callers
Method
Concat
Add all of other's keys starting from idx and children starting from idx + 1
structure/tree/btree.go:107
↓ 2 callers
Function
ConstructTrie
ConstructTrie Function that constructs Trie as an automaton for a set of reversed & trimmed strings.
strings/ahocorasick/shared.go:4
↓ 2 callers
Function
CreateNewState
CreateNewState Automaton function for creating a new state 'state'.
strings/ahocorasick/shared.go:111
↓ 2 callers
Function
DecimalToBinary
DecimalToBinary() function that will take Decimal number as int, and return its Binary equivalent as a string.
conversion/decimaltobinary.go:34
↓ 2 callers
Function
Decrypt
Decrypt decrypts encrypted rune slice based on the RSA algorithm
cipher/rsa/rsa.go:45
↓ 2 callers
Method
DecryptString
DecryptString decrypts the data using RSA algorithm returns the decrypted string
cipher/rsa/rsa2.go:80
↓ 2 callers
Function
DefaultPolynomial
DefaultPolynomial is the commonly used polynomial g(x) = (x^2 + 1) mod n
math/pollard.go:18
↓ 2 callers
Method
DelAtBeg
DelAtBeg deletes the snode at the head(beginning) of the list and returns its value. Returns false if the list is empty.
structure/linkedlist/singlylinkedlist.go:50
↓ 2 callers
Function
DepthFirstSearch
(start, end int, nodes []int, edges [][]bool)
graph/depthfirstsearch.go:59
↓ 2 callers
Function
DepthFirstSearchHelper
(start, end int, nodes []int, edges [][]bool, showroute bool)
graph/depthfirstsearch.go:27
↓ 2 callers
Method
DequeueFront
DequeueFront deletes an item from front of Deque and returns it.
structure/deque/deque.go:37
↓ 2 callers
Method
DequeueRear
DequeueRear deletes an item from rear of Deque and returns it.
structure/deque/deque.go:48
↓ 2 callers
Method
Destroy
Destroy all items in the list.
structure/linkedlist/cyclic.go:100
↓ 2 callers
Function
Encrypt
Encrypt encrypts based on the RSA algorithm - uses modular exponentitation in math directory
cipher/rsa/rsa.go:30
↓ 2 callers
Method
EnqueueFront
EnqueueFront adds an item at the front of Deque.
structure/deque/deque.go:27
↓ 2 callers
Method
EnqueueRear
EnqueueRear adds an item at the rear of Deque.
structure/deque/deque.go:32
↓ 2 callers
Function
EuclideanDistance
EuclideanDistance returns the Euclidean distance between points in any `n` dimensional Euclidean space.
math/geometry/distance.go:22
↓ 2 callers
Function
Extended
Extended simple extended gcd
math/gcd/extended.go:14
↓ 2 callers
Function
Formula
Formula This function calculates the n-th fibonacci number using the [formula](https://en.wikipedia.org/wiki/Fibonacci_number#Relation_to_the_golden_r
math/fibonacci/fibonacci.go:44
↓ 2 callers
Method
Front
Front it will return the front value
structure/queue/queuelinklistwithlist.go:43
↓ 2 callers
Method
Front
Front gets the front item from queue.
structure/deque/deque.go:59
↓ 2 callers
Function
FrontQueue
FrontQueue return the Front value
structure/queue/queuearray.go:27
↓ 2 callers
Function
Generate
Generate returns a int slice of prime numbers up to the limit
math/prime/sieve.go:26
↓ 2 callers
Function
GenerateChannel
Generate generates the sequence of integers starting at 2 and sends it to the channel `ch`
math/prime/sieve.go:9
↓ 2 callers
Function
GenerateMutualKey
GenerateMutualKey : generates a mutual key that can be used by only alice and bob mutualKey = (shareKey^prvKey)%primeNumber
cipher/diffiehellman/diffiehellmankeyexchange.go:23
↓ 2 callers
Function
GenerateShareKey
GenerateShareKey : generates a key using client private key , generator and primeNumber this key can be made public shareKey = (g^key)%primeNumber
cipher/diffiehellman/diffiehellmankeyexchange.go:17
↓ 2 callers
Function
GenerateTriangle
GenerateTriangle This function generates a Pascal's triangle of n lines
math/pascal/pascaltriangle.go:26
↓ 2 callers
Method
Get
Get function is return one element with the index of array
structure/dynamicarray/dynamicarray.go:67
↓ 2 callers
Method
GetDad
(int)
graph/lowestcommonancestor.go:23
↓ 2 callers
Method
GetDepth
(int)
graph/lowestcommonancestor.go:22
↓ 2 callers
Function
GetParent
GetParent Function that finds the first previous state of a state and returns it. Used for trie where there is only one parent.
strings/ahocorasick/shared.go:99
↓ 2 callers
Method
GetPublicKey
GetPublicKey returns the public key (y)
cipher/dsa/dsa.go:184
↓ 2 callers
Function
GetWord
GetWord Function that returns word found in text 't' at position range 'begin' to 'end'.
strings/ahocorasick/shared.go:49
↓ 2 callers
Function
HEXToRGB
HEXToRGB splits an RGB input (e.g. a color in hex format; 0x<color-code>) into the individual components: red, green and blue
conversion/rgbhex.go:12
↓ 2 callers
Method
HasCycle
()
graph/cycle.go:10
↓ 2 callers
Function
Hash
Hash hashes the input message using the sha256 hashing function, and return a 32 byte array. The implementation follows the RGC6234 standard, which is
hashing/sha256/sha256.go:52
↓ 2 callers
Function
Horspool
(t, p string)
strings/horspool/horspool.go:10
↓ 2 callers
Method
Init
Init initializes double linked list
structure/linkedlist/doubly.go:23
↓ 2 callers
Method
InsertKeyChild
(key T, child *BTreeNode[T])
structure/tree/btree.go:81
↓ 2 callers
Function
Insertion
(arr []T)
sort/insertionsort.go:11
↓ 2 callers
Function
Interpolation
Interpolation searches for the entity in the given sortedData. if the entity is present, it will return the index of the entity, if not -1 will be ret
search/interpolation.go:15
↓ 2 callers
Method
IsEmpty
IsEmpty returns true if the stack is empty, false otherwise.
structure/stack/stackarray.go:41
↓ 2 callers
Method
IsEmpty
IsEmpty checks whether Deque is empty or not.
structure/deque/deque.go:77
↓ 2 callers
Function
IsKrishnamurthyNumber
IsKrishnamurthyNumber returns if the provided number n is a Krishnamurthy number or not.
math/krishnamurthy.go:14
↓ 2 callers
Function
IsPalindrome
(text string)
strings/palindrome/ispalindrome.go:26
↓ 2 callers
Function
IsPerfectNumber
Checks if inNumber is a perfect number
math/perfectnumber.go:36
↓ 2 callers
Function
IsPowOfTwoUseLog
IsPowOfTwoUseLog This function checks if a number is a power of two using the logarithm. The limiting degree can be from 0 to 63. See alternatives in
math/checkisnumberpoweroftwo.go:10
↓ 2 callers
Function
IsPowerOfTwo
IsPowerOfTwo This function uses the fact that powers of 2 are represented like 10...0 in binary, and numbers one less than the power of 2 are represen
math/binary/checkisnumberpoweroftwo.go:23
↓ 2 callers
Function
IsPowerOfTwoLeftShift
IsPowerOfTwoLeftShift This function takes advantage of the fact that left shifting a number by 1 is equivalent to multiplying by 2. For example, binar
math/binary/checkisnumberpoweroftwo.go:30
↓ 2 callers
Method
IsProperSubsetOf
IsProperSubsetOf: checks whether set is proper subset of set2 or not. ex: [1,2,3] proper subset of [1,2,3,4] -> true
structure/set/set.go:33
↓ 2 callers
Method
IsProperSupersetOf
IsProperSupersetOf: checks whether set is proper superset of set2 or not. ex: [1,2,3,4] proper superset of [1,2,3] -> true
structure/set/set.go:38
↓ 2 callers
Function
Iterative
Iterative returns the iteratively brute forced factorial of n
math/factorial/factorial.go:20
↓ 2 callers
Function
IterativePower
IterativePower is iterative O(logn) function for pow(x, y)
math/power/fastexponent.go:4
↓ 2 callers
Function
Jump
Jump search works by jumping multiple steps ahead in sorted list until it find an item larger than target, then create a sublist of item from the last
search/jump.go:17
↓ 2 callers
Function
Jump2
(arr []int, target int)
search/jump2.go:5
↓ 2 callers
Method
Kind
()
project_euler/problem_18/problem18.go:43
↓ 2 callers
Function
Knapsack
Knapsack solves knapsack problem return maxProfit
dynamic/knapsack.go:20
↓ 2 callers
Method
Length
Length gets the length of Deque.
structure/deque/deque.go:82
↓ 2 callers
Function
Linear
Linear Simple linear search algorithm that iterates over all elements of an array in the worst case scenario
search/linear.go:4
↓ 2 callers
Function
LiouvilleLambda
Lambda is the liouville function This function returns λ(n) for given number
math/liouville.go:26
↓ 2 callers
Function
LogBase2
LogBase2 Finding the exponent of n = 2**x using bitwise operations (logarithm in base 2 of n) [See more](https://en.wikipedia.org/wiki/Logarithm)
math/binary/logarithm.go:9
↓ 2 callers
Function
LongestCommonSubsequence
LongestCommonSubsequence function
dynamic/longestcommonsubsequence.go:16
↓ 2 callers
Function
LowerBound
LowerBound returns index to the first element in the range [0, len(array)-1] that is not less than (i.e. greater or equal to) target. return -1 and Er
search/binary.go:42
↓ 2 callers
Function
LowestCommonAncestor
For each node, we will precompute its ancestor above him, its ancestor two nodes above, its ancestor four nodes above, etc. Let's call `jump[j][u]` is
graph/lowestcommonancestor.go:113
↓ 2 callers
Function
Luhn
Luhn validates the provided data using the Luhn algorithm.
checksum/luhn.go:13
↓ 2 callers
Function
Matrix
Matrix This function calculates the n-th fibonacci number using the matrix method. [See](https://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form)
math/fibonacci/fibonacci.go:17
↓ 2 callers
Function
MeanUsingAndXor
MeanUsingAndXor This function finds arithmetic mean using "AND" and "XOR" operations
math/binary/arithmeticmean.go:14
↓ 2 callers
Function
MeanUsingRightShift
MeanUsingRightShift This function finds arithmetic mean using right shift
math/binary/arithmeticmean.go:19
↓ 2 callers
Function
MonteCarloPi
(randomPoints int)
math/pi/montecarlopi.go:19
↓ 2 callers
Function
MonteCarloPiConcurrent
MonteCarloPiConcurrent approximates the value of pi using the Monte Carlo method. Unlike the MonteCarloPi function (first version), this implementatio
math/pi/montecarlopi.go:38
↓ 2 callers
Method
More
(any)
sort/heapsort.go:119
↓ 2 callers
Method
MoveToBack
(n *Node[T])
structure/linkedlist/doubly.go:206
↓ 2 callers
Function
NewTree
(numbersVertex, root int, edges []TreeEdge)
graph/lowestcommonancestor.go:86
↓ 2 callers
Function
NewUnionFind
Initialise a new union find data structure with s nodes
graph/unionfind.go:25
↓ 2 callers
Function
Partition
(arr []T, low, high int)
sort/quicksort.go:15
↓ 2 callers
Function
Phi
Phi is the Euler totient function. This function computes the number of numbers less then n that are coprime with n.
math/eulertotient.go:5
↓ 2 callers
Function
PollardsRhoFactorization
PollardsRhoFactorization is an implementation of Pollard's rho factorization algorithm using the default parameters x = y = 2
math/pollard.go:31
↓ 2 callers
Function
Problem1
(n uint)
project_euler/problem_1/problem1.go:14
↓ 2 callers
Function
Problem10
(n int)
project_euler/problem_10/problem10.go:14
↓ 2 callers
Function
Problem11
()
project_euler/problem_11/problem11.go:39
↓ 2 callers
Function
Problem12
(limit uint)
project_euler/problem_12/problem12.go:28
↓ 2 callers
Function
Problem13
()
project_euler/problem_13/problem13.go:114
↓ 2 callers
Function
Problem14
(limit uint64)
project_euler/problem_14/problem14.go:26
↓ 2 callers
Function
Problem15
(gridSize int)
project_euler/problem_15/problem15.go:19
↓ 2 callers
Function
Problem16
(exponent int64)
project_euler/problem_16/problem16.go:17
↓ 2 callers
Function
Problem17
(input string)
project_euler/problem_17/problem17.go:21
↓ 2 callers
Function
Problem18
(input []string, deep int)
project_euler/problem_18/problem18.go:50
↓ 2 callers
Function
Problem19
** * Problem 19 - Counting Sundays * @see {@link https://projecteuler.net/problem=19} * * You are given the following information, * but you may prefe
project_euler/problem_19/problem19.go:26
↓ 2 callers
Function
Problem2
(n uint)
project_euler/problem_2/problem2.go:17
↓ 2 callers
Function
Problem20
(input int)
project_euler/problem_20/problem20.go:18
← previous
next →
201–300 of 1,378, ranked by callers