MCPcopy Create free account

hub / github.com/TheAlgorithms/Go / functions

Functions1,378 in github.com/TheAlgorithms/Go

↓ 2 callersMethodAppend
(key T, child *BTreeNode[T])
structure/tree/btree.go:100
↓ 2 callersFunctionArrayUnion
ArrayUnion Concats two arrays of int's into one.
strings/ahocorasick/shared.go:86
↓ 2 callersMethodBack
()
structure/linkedlist/doubly.go:198
↓ 2 callersFunctionBackQueue
BackQueue return the Back value
structure/queue/queuearray.go:32
↓ 2 callersFunctionBinary
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 callersFunctionBinaryIterative
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 callersFunctionBinaryToDecimal
BinaryToDecimal() function that will take Binary number as string, and return its Decimal equivalent as an integer.
conversion/binarytodecimal.go:27
↓ 2 callersFunctionBitwise
Bitwise This function returns the minimum integer using bit operations
math/min/bitwisemin.go:11
↓ 2 callersFunctionCatalanNumber
CatalanNumber This function returns the `nth` Catalan number
math/catalan/catalannumber.go:26
↓ 2 callersFunctionCombinations
C is Binomial Coefficient function This function returns C(n, k) for given n and k
math/binomialcoefficient.go:22
↓ 2 callersMethodConcat
Add all of other's keys starting from idx and children starting from idx + 1
structure/tree/btree.go:107
↓ 2 callersFunctionConstructTrie
ConstructTrie Function that constructs Trie as an automaton for a set of reversed & trimmed strings.
strings/ahocorasick/shared.go:4
↓ 2 callersFunctionCreateNewState
CreateNewState Automaton function for creating a new state 'state'.
strings/ahocorasick/shared.go:111
↓ 2 callersFunctionDecimalToBinary
DecimalToBinary() function that will take Decimal number as int, and return its Binary equivalent as a string.
conversion/decimaltobinary.go:34
↓ 2 callersFunctionDecrypt
Decrypt decrypts encrypted rune slice based on the RSA algorithm
cipher/rsa/rsa.go:45
↓ 2 callersMethodDecryptString
DecryptString decrypts the data using RSA algorithm returns the decrypted string
cipher/rsa/rsa2.go:80
↓ 2 callersFunctionDefaultPolynomial
DefaultPolynomial is the commonly used polynomial g(x) = (x^2 + 1) mod n
math/pollard.go:18
↓ 2 callersMethodDelAtBeg
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 callersFunctionDepthFirstSearch
(start, end int, nodes []int, edges [][]bool)
graph/depthfirstsearch.go:59
↓ 2 callersFunctionDepthFirstSearchHelper
(start, end int, nodes []int, edges [][]bool, showroute bool)
graph/depthfirstsearch.go:27
↓ 2 callersMethodDequeueFront
DequeueFront deletes an item from front of Deque and returns it.
structure/deque/deque.go:37
↓ 2 callersMethodDequeueRear
DequeueRear deletes an item from rear of Deque and returns it.
structure/deque/deque.go:48
↓ 2 callersMethodDestroy
Destroy all items in the list.
structure/linkedlist/cyclic.go:100
↓ 2 callersFunctionEncrypt
Encrypt encrypts based on the RSA algorithm - uses modular exponentitation in math directory
cipher/rsa/rsa.go:30
↓ 2 callersMethodEnqueueFront
EnqueueFront adds an item at the front of Deque.
structure/deque/deque.go:27
↓ 2 callersMethodEnqueueRear
EnqueueRear adds an item at the rear of Deque.
structure/deque/deque.go:32
↓ 2 callersFunctionEuclideanDistance
EuclideanDistance returns the Euclidean distance between points in any `n` dimensional Euclidean space.
math/geometry/distance.go:22
↓ 2 callersFunctionExtended
Extended simple extended gcd
math/gcd/extended.go:14
↓ 2 callersFunctionFormula
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 callersMethodFront
Front it will return the front value
structure/queue/queuelinklistwithlist.go:43
↓ 2 callersMethodFront
Front gets the front item from queue.
structure/deque/deque.go:59
↓ 2 callersFunctionFrontQueue
FrontQueue return the Front value
structure/queue/queuearray.go:27
↓ 2 callersFunctionGenerate
Generate returns a int slice of prime numbers up to the limit
math/prime/sieve.go:26
↓ 2 callersFunctionGenerateChannel
Generate generates the sequence of integers starting at 2 and sends it to the channel `ch`
math/prime/sieve.go:9
↓ 2 callersFunctionGenerateMutualKey
GenerateMutualKey : generates a mutual key that can be used by only alice and bob mutualKey = (shareKey^prvKey)%primeNumber
cipher/diffiehellman/diffiehellmankeyexchange.go:23
↓ 2 callersFunctionGenerateShareKey
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 callersFunctionGenerateTriangle
GenerateTriangle This function generates a Pascal's triangle of n lines
math/pascal/pascaltriangle.go:26
↓ 2 callersMethodGet
Get function is return one element with the index of array
structure/dynamicarray/dynamicarray.go:67
↓ 2 callersMethodGetDad
(int)
graph/lowestcommonancestor.go:23
↓ 2 callersMethodGetDepth
(int)
graph/lowestcommonancestor.go:22
↓ 2 callersFunctionGetParent
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 callersMethodGetPublicKey
GetPublicKey returns the public key (y)
cipher/dsa/dsa.go:184
↓ 2 callersFunctionGetWord
GetWord Function that returns word found in text 't' at position range 'begin' to 'end'.
strings/ahocorasick/shared.go:49
↓ 2 callersFunctionHEXToRGB
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 callersMethodHasCycle
()
graph/cycle.go:10
↓ 2 callersFunctionHash
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 callersFunctionHorspool
(t, p string)
strings/horspool/horspool.go:10
↓ 2 callersMethodInit
Init initializes double linked list
structure/linkedlist/doubly.go:23
↓ 2 callersMethodInsertKeyChild
(key T, child *BTreeNode[T])
structure/tree/btree.go:81
↓ 2 callersFunctionInsertion
(arr []T)
sort/insertionsort.go:11
↓ 2 callersFunctionInterpolation
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 callersMethodIsEmpty
IsEmpty returns true if the stack is empty, false otherwise.
structure/stack/stackarray.go:41
↓ 2 callersMethodIsEmpty
IsEmpty checks whether Deque is empty or not.
structure/deque/deque.go:77
↓ 2 callersFunctionIsKrishnamurthyNumber
IsKrishnamurthyNumber returns if the provided number n is a Krishnamurthy number or not.
math/krishnamurthy.go:14
↓ 2 callersFunctionIsPalindrome
(text string)
strings/palindrome/ispalindrome.go:26
↓ 2 callersFunctionIsPerfectNumber
Checks if inNumber is a perfect number
math/perfectnumber.go:36
↓ 2 callersFunctionIsPowOfTwoUseLog
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 callersFunctionIsPowerOfTwo
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 callersFunctionIsPowerOfTwoLeftShift
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 callersMethodIsProperSubsetOf
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 callersMethodIsProperSupersetOf
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 callersFunctionIterative
Iterative returns the iteratively brute forced factorial of n
math/factorial/factorial.go:20
↓ 2 callersFunctionIterativePower
IterativePower is iterative O(logn) function for pow(x, y)
math/power/fastexponent.go:4
↓ 2 callersFunctionJump
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 callersFunctionJump2
(arr []int, target int)
search/jump2.go:5
↓ 2 callersMethodKind
()
project_euler/problem_18/problem18.go:43
↓ 2 callersFunctionKnapsack
Knapsack solves knapsack problem return maxProfit
dynamic/knapsack.go:20
↓ 2 callersMethodLength
Length gets the length of Deque.
structure/deque/deque.go:82
↓ 2 callersFunctionLinear
Linear Simple linear search algorithm that iterates over all elements of an array in the worst case scenario
search/linear.go:4
↓ 2 callersFunctionLiouvilleLambda
Lambda is the liouville function This function returns λ(n) for given number
math/liouville.go:26
↓ 2 callersFunctionLogBase2
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 callersFunctionLongestCommonSubsequence
LongestCommonSubsequence function
dynamic/longestcommonsubsequence.go:16
↓ 2 callersFunctionLowerBound
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 callersFunctionLowestCommonAncestor
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 callersFunctionLuhn
Luhn validates the provided data using the Luhn algorithm.
checksum/luhn.go:13
↓ 2 callersFunctionMatrix
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 callersFunctionMeanUsingAndXor
MeanUsingAndXor This function finds arithmetic mean using "AND" and "XOR" operations
math/binary/arithmeticmean.go:14
↓ 2 callersFunctionMeanUsingRightShift
MeanUsingRightShift This function finds arithmetic mean using right shift
math/binary/arithmeticmean.go:19
↓ 2 callersFunctionMonteCarloPi
(randomPoints int)
math/pi/montecarlopi.go:19
↓ 2 callersFunctionMonteCarloPiConcurrent
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 callersMethodMore
(any)
sort/heapsort.go:119
↓ 2 callersMethodMoveToBack
(n *Node[T])
structure/linkedlist/doubly.go:206
↓ 2 callersFunctionNewTree
(numbersVertex, root int, edges []TreeEdge)
graph/lowestcommonancestor.go:86
↓ 2 callersFunctionNewUnionFind
Initialise a new union find data structure with s nodes
graph/unionfind.go:25
↓ 2 callersFunctionPartition
(arr []T, low, high int)
sort/quicksort.go:15
↓ 2 callersFunctionPhi
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 callersFunctionPollardsRhoFactorization
PollardsRhoFactorization is an implementation of Pollard's rho factorization algorithm using the default parameters x = y = 2
math/pollard.go:31
↓ 2 callersFunctionProblem1
(n uint)
project_euler/problem_1/problem1.go:14
↓ 2 callersFunctionProblem10
(n int)
project_euler/problem_10/problem10.go:14
↓ 2 callersFunctionProblem11
()
project_euler/problem_11/problem11.go:39
↓ 2 callersFunctionProblem12
(limit uint)
project_euler/problem_12/problem12.go:28
↓ 2 callersFunctionProblem13
()
project_euler/problem_13/problem13.go:114
↓ 2 callersFunctionProblem14
(limit uint64)
project_euler/problem_14/problem14.go:26
↓ 2 callersFunctionProblem15
(gridSize int)
project_euler/problem_15/problem15.go:19
↓ 2 callersFunctionProblem16
(exponent int64)
project_euler/problem_16/problem16.go:17
↓ 2 callersFunctionProblem17
(input string)
project_euler/problem_17/problem17.go:21
↓ 2 callersFunctionProblem18
(input []string, deep int)
project_euler/problem_18/problem18.go:50
↓ 2 callersFunctionProblem19
** * 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 callersFunctionProblem2
(n uint)
project_euler/problem_2/problem2.go:17
↓ 2 callersFunctionProblem20
(input int)
project_euler/problem_20/problem20.go:18
← previousnext →201–300 of 1,378, ranked by callers