MCPcopy Create free account

hub / github.com/TheAlgorithms/Go / functions

Functions1,378 in github.com/TheAlgorithms/Go

↓ 1 callersMethodPut
Put function is change/update the value in array with the index and new value
structure/dynamicarray/dynamicarray.go:28
↓ 1 callersMethodQuery
Query returns the sum of elements of the array in the interval [firstIndex, leftIndex]. node, leftNode and rightNode should always start with 1, 0 and
structure/segmenttree/segmenttree.go:47
↓ 1 callersMethodQuery
Performs a query from index start to index end (non included) Assumptions: - start < end - start and end are valid
sqrt/sqrtdecomposition.go:65
↓ 1 callersFunctionQuicksortRange
QuicksortRange Sorts the specified range within the array
sort/quicksort.go:29
↓ 1 callersMethodRangeSum
RangeSum returns the sum of the elements in the range l to r both inclusive.
structure/fenwicktree/fenwicktree.go:50
↓ 1 callersFunctionRecursive
Recursive calculates the n-th fibonacci number recursively by adding the previous two Fibonacci numbers. This algorithm is extremely slow for bigger n
math/fibonacci/fibonacci.go:53
↓ 1 callersMethodRemove
Remove function is remove an element with the index
structure/dynamicarray/dynamicarray.go:51
↓ 1 callersFunctionReverse
Reverse() function that will take string, and returns the reverse of that string.
conversion/decimaltobinary.go:24
↓ 1 callersMethodReversePartition
ReversePartition Reverse the linked list from the ath to the bth node
structure/linkedlist/singlylinkedlist.go:142
↓ 1 callersFunctionSection
Section calculates the Point that divides a line in specific ratio. DO NOT specify the ratio in the form m:n, specify it as r, where r = m / n.
math/geometry/straightlines.go:24
↓ 1 callersMethodShow
show all value as an interface array
structure/stack/stacklinkedlist.go:64
↓ 1 callersMethodSize
()
sort/heapsort.go:60
↓ 1 callersFunctionSymbolCountOrd
SymbolCountOrd computes sorted symbol-frequency list of input message
compression/huffmancoding_test.go:16
↓ 1 callersMethodSymmetricDifference
SymmetricDifference: gives new symmetric difference set of both sets. ex: [1,2,3] SymmetricDifference [3,4,5] -> [1,2,4,5]
structure/set/set.go:50
↓ 1 callersFunctionTernaryMax
TernaryMax is a function to search for maximum value of a uni-modal function `f` in the interval [a, b]. a and b should be finit numbers
search/ternary.go:10
↓ 1 callersFunctionTernaryMin
TernaryMin is a function to search for minimum value of a uni-modal function `f` in the interval [a, b]. a and b should be finit numbers.
search/ternary.go:27
↓ 1 callersFunctionTilingProblem
TilingProblem returns the number of ways to tile a 2xN grid using 2x1 dominoes
dynamic/tilingproblem.go:10
↓ 1 callersMethodTop
Top returns the minimum element (according to Less) from the heap. Top panics if the heap is empty.
structure/heap/heap.go:42
↓ 1 callersFunctionTopological
Topological assumes that graph given is valid and that its possible to get a topological ordering. constraints are array of []int{a, b}, representing
graph/topological.go:14
↓ 1 callersFunctionTrapRainWater
TrapRainWater calculates the amount of trapped rainwater between the bars represented by the given elevation map. It uses dynamic programming to preco
dynamic/traprainwater.go:19
↓ 1 callersMethodTryBipartiteColoring
Bipartite.go description: Implementation of the Bipartite graph coloring algorithm details: A bipartite graph is a graph whose vertices can be divided
graph/coloring/bipartite.go:9
↓ 1 callersMethodUnion
Union: gives new union set of both sets. ex: [1,2,3] union [3,4,5] -> [1,2,3,4,5]
structure/set/set.go:41
↓ 1 callersFunctionUniquePaths
UniquePaths implements the solution to the "Unique Paths" problem
dynamic/uniquepaths.go:8
↓ 1 callersMethodUpdate
(i Comparable)
sort/heapsort.go:64
↓ 1 callersMethodUpdate
Update updates the elements of the array in the range [firstIndex, lastIndex] with the new value provided and recomputes the sum of different ranges.
structure/segmenttree/segmenttree.go:73
↓ 1 callersMethodUpdate
Assumptions: - index is valid
sqrt/sqrtdecomposition.go:98
↓ 1 callersMethodWalk
Show list body.
structure/linkedlist/cyclic.go:107
↓ 1 callersFunctionWordBreak
WordBreak checks if the input string can be segmented into words from a dictionary
dynamic/wordbreak.go:10
↓ 1 callersFunctionYIntercept
YIntercept calculates the Y-Intercept of a line from a specific Point.
math/geometry/straightlines.go:37
↓ 1 callersFunctionadd
(a, b string)
project_euler/problem_13/problem13.go:124
↓ 1 callersFunctionaddBytes
This function get the result of adding the bytes in data to the crc
checksum/crc8.go:38
↓ 1 callersMethodaddEdge
(int, int)
graph/lowestcommonancestor.go:21
↓ 1 callersFunctionarticulationPointHelper
articulationPointHelper recursively traverses the graph using DFS and marks articulation points. It updates `childCount`, `discoveryTime`, and `earlie
graph/articulationpoints.go:46
↓ 1 callersFunctionbigFactorial
bigFactorial returns the factorial of n as a big.Int Use big package to handle large numbers
project_euler/problem_20/problem20.go:29
↓ 1 callersFunctioncalculateRunSize
calculateRunSize returns a run size parameter that is further used to slice the data slice.
sort/timsort.go:22
↓ 1 callersFunctioncleanString
(text string)
strings/pangram/ispangram.go:14
↓ 1 callersMethodcolorVertex
colorVertex will try to color provided vertex, v
graph/coloring/backtracking.go:24
↓ 1 callersFunctioncomputeShiftMap
(t, p []rune)
strings/horspool/horspool.go:51
↓ 1 callersFunctioncountSort
(arr []T, exp T)
sort/radixsort.go:16
↓ 1 callersMethoddecipher
(chars []rune)
cipher/polybius/polybius.go:89
↓ 1 callersFunctiondelChar
(s string, index int)
math/pi/spigotpi.go:58
↓ 1 callersMethoddeleteFix
(x *RBNode[T])
structure/tree/rbtree.go:352
↓ 1 callersMethoddeleteHelper
(root *AVLNode[T], key T)
structure/tree/avl.go:224
↓ 1 callersMethoddeleteHelper
(z *BSNode[T])
structure/tree/bstree.go:195
↓ 1 callersMethoddeleteHelper
(node *RBNode[T], key T)
structure/tree/rbtree.go:300
↓ 1 callersFunctiondoSort
doSort is the recursive function that implements the circle sort algorithm.
sort/circlesort.go:17
↓ 1 callersMethoddown
(parent int)
structure/heap/heap.go:84
↓ 1 callersFunctiondrawPoints
drawPoints draws n random two-dimensional points in the interval [0, 1), [0, 1) and sends through c the number of points which where within the circle
math/pi/montecarlopi.go:61
↓ 1 callersMethoddsaParameterGeneration
Parameter generation for DSA 1. FIPS 186-4 specifies that the L and N values must be (1024, 160), (2048, 224), or (3072, 256) 2. Choose a N-bit prime
cipher/dsa/dsa.go:50
↓ 1 callersMethodeliminate
eliminate clear the least frequently operated element
cache/lfu.go:120
↓ 1 callersMethodencipher
(char rune)
cipher/polybius/polybius.go:78
↓ 1 callersMethodfillOrder
Helper function to fill the stack with vertices in the order of their finish times.
graph/kosaraju.go:50
↓ 1 callersMethodfindAllCyclesHelper
(current int, all, visiting, visited map[int]struct{})
graph/cycle.go:90
↓ 1 callersFunctionformatNum
formatNum accepts a number and returns the odd number d such that num = 2^s * d + 1
math/prime/millerrabintest.go:21
↓ 1 callersFunctiongenerateNthTerm
(num int)
math/moserdebruijnsequence/sequence.go:20
↓ 1 callersFunctiongenerateQuery
(tree *Tree)
graph/lowestcommonancestor_test.go:203
↓ 1 callersFunctiongenerateTree
()
graph/lowestcommonancestor_test.go:149
↓ 1 callersFunctiongetAbsTests
()
math/binary/abs_test.go:16
↓ 1 callersFunctiongetBurstBalloonsTestCases
()
dynamic/burstballoons_test.go:14
↓ 1 callersFunctiongetDiceThrowTestCases
getDiceThrowTestCases provides the test cases for DiceThrow
dynamic/dicethrow_test.go:17
↓ 1 callersFunctiongetEggDroppingTestCases
()
dynamic/eggdropping_test.go:15
↓ 1 callersFunctiongetIndex
(wordSet []rune, subString rune)
cipher/transposition/transposition.go:43
↓ 1 callersFunctiongetInterleavingTestCases
()
dynamic/interleavingstrings_test.go:14
↓ 1 callersFunctiongetIsPerfectNumberTestCases
getIsPerfectNumberTestCases returns an array of test data for the tests of the function IsPerfectNumber Data was verified using [A000396]. [A000396]:
math/perfectnumber_test.go:117
↓ 1 callersFunctiongetLongestArithmeticSubsequenceTestCases
()
dynamic/longestarithmeticsubsequence_test.go:14
↓ 1 callersFunctiongetLongestPalindromicSubstringTestCases
()
dynamic/longestpalindromicsubstring_test.go:14
↓ 1 callersFunctiongetMaxSubArraySumTestCases
()
dynamic/maxsubarraysum_test.go:14
↓ 1 callersFunctiongetNextGap
(gap int)
sort/combSort.go:11
↓ 1 callersFunctiongetOptimalBSTTestCases
()
dynamic/optimalbst_test.go:16
↓ 1 callersFunctiongetPartitionProblemTestCases
getPartitionProblemTestCases returns a list of test cases for the Partition Problem
dynamic/partitionproblem_test.go:16
↓ 1 callersFunctiongetRodCuttingTestCases
()
dynamic/rodcutting_test.go:15
↓ 1 callersFunctiongetSumOfProperDivisorsTestCases
getSumOfProperDivisorsTestCases returns an array of test data for the tests of the function SumOfProperDivisors. Data was verified using [A001065]. [A
math/perfectnumber_test.go:18
↓ 1 callersFunctiongetTable
This function get 256-byte (256x8) table for efficient processing.
checksum/crc8.go:53
↓ 1 callersFunctiongetTestGraphsForNegativeTests
()
graph/coloring/graph_test.go:131
↓ 1 callersFunctiongetTests
()
strings/manacher/longestpalindrome_test.go:10
↓ 1 callersFunctiongetTests
()
math/abs_test.go:20
↓ 1 callersFunctiongetTestsForPhi
()
math/eulertotient_test.go:7
↓ 1 callersFunctiongetTestsForPowerOfTwo
()
math/checkisnumberpoweroftwo_test.go:13
↓ 1 callersFunctiongetTilingProblemTestCases
()
dynamic/tilingproblem_test.go:14
↓ 1 callersFunctiongetWildcardMatchingTestCases
getWildcardMatchingTestCases returns a list of test cases for the Wildcard Matching problem
dynamic/wildcardmatching_test.go:17
↓ 1 callersFunctiongetWordBreakTestCases
()
dynamic/wordbreak_test.go:15
↓ 1 callersMethodhasCycleHelper
(v int, all, visiting, visited map[int]struct{})
graph/cycle.go:30
↓ 1 callersFunctionhasDigit
(text string)
strings/isisogram.go:24
↓ 1 callersFunctionhasSymbol
(text string)
strings/isisogram.go:29
↓ 1 callersFunctionhorspool
(t, p []rune)
strings/horspool/horspool.go:16
↓ 1 callersFunctioninitItem
initItem to init item for LFU
cache/lfu.go:44
↓ 1 callersFunctioninnerStooge
(arr []T, i int32, j int32)
sort/stooge_sort.go:15
↓ 1 callersMethodinsert
(n, at *Node[T])
structure/linkedlist/doubly.go:42
↓ 1 callersMethodinsert
insert a single word at a Trie node.
structure/trie/trie.go:22
↓ 1 callersFunctioninsertionSortRuns
insertionSortRuns runs insertion sort on all the data runs one by one.
sort/timsort.go:36
↓ 1 callersFunctionisDivisible
(n, limit uint)
project_euler/problem_5/problem5.go:25
↓ 1 callersFunctionisMatch
Checks if the array p matches the subarray of t starting at pos. Note that backward iteration. There are [other](https://en.wikipedia.org/wiki/Boyer%E
strings/horspool/horspool.go:43
↓ 1 callersFunctionisPalindromeRecursiveHelper
(runes []rune, start int64, end int64)
strings/palindrome/ispalindrome.go:45
↓ 1 callersFunctionisSorted
(arr []T)
sort/bogosort.go:16
↓ 1 callersMethodkeyGen
keyGen is key generation for DSA 1. Choose a random integer x from the range [1, q-1] 2. Compute y = g^x mod p
cipher/dsa/dsa.go:108
↓ 1 callersFunctionleftRotate
leftRotate rotates x left by n bits
hashing/md5/md5.go:43
↓ 1 callersFunctionlowerBound
Function to find the leftmost index in arr with value >= val, mimicking the inbuild lower_bound function in C++ Time Complexity: O(logn) Auxiliary Spa
dynamic/longestincreasingsubsequencegreedy.go:29
↓ 1 callersFunctionlpsRec
(word string, i, j int)
dynamic/longestpalindromicsubsequence.go:8
↓ 1 callersFunctionmakeBoundaries
(s string)
strings/manacher/longestpalindrome.go:15
↓ 1 callersFunctionmaximum
(node, nilNode Node[T])
structure/tree/tree.go:125
← previousnext →501–600 of 1,378, ranked by callers