TheAlgorithms / Go

Algorithms and Data Structures implemented in Go for beginners, following best practices.
https://the-algorithms.com/language/go
MIT License
14.81k stars 2.5k forks source link
algorithms algorithms-implemented community-driven data-structures datastructures hacktoberfest interview interview-preparation preparation search sorting

The Algorithms - Go

Gitpod Ready-to-Code  Continuous Integration codecov godocmd   update_directory_md Discord chat 

Algorithms implemented in Go (for education)

The repository is a collection of open-source implementation of a variety of algorithms implemented in Go and licensed under MIT License.

Read our Contribution Guidelines before you contribute.

List of Algorithms

Packages:

ahocorasick --- ##### Functions: 1. [`Advanced`](./strings/ahocorasick/advancedahocorasick.go#L10): Advanced Function performing the Advanced Aho-Corasick algorithm. Finds and prints occurrences of each pattern. 2. [`AhoCorasick`](./strings/ahocorasick/ahocorasick.go#L15): AhoCorasick Function performing the Basic Aho-Corasick algorithm. Finds and prints occurrences of each pattern. 3. [`ArrayUnion`](./strings/ahocorasick/shared.go#L86): ArrayUnion Concats two arrays of int's into one. 4. [`BoolArrayCapUp`](./strings/ahocorasick/shared.go#L78): BoolArrayCapUp Dynamically increases an array size of bool's by 1. 5. [`BuildAc`](./strings/ahocorasick/ahocorasick.go#L54): Functions that builds Aho Corasick automaton. 6. [`BuildExtendedAc`](./strings/ahocorasick/advancedahocorasick.go#L46): BuildExtendedAc Functions that builds extended Aho Corasick automaton. 7. [`ComputeAlphabet`](./strings/ahocorasick/shared.go#L61): ComputeAlphabet Function that returns string of all the possible characters in given patterns. 8. [`ConstructTrie`](./strings/ahocorasick/shared.go#L4): ConstructTrie Function that constructs Trie as an automaton for a set of reversed & trimmed strings. 9. [`Contains`](./strings/ahocorasick/shared.go#L39): Contains Returns 'true' if array of int's 's' contains int 'e', 'false' otherwise. 10. [`CreateNewState`](./strings/ahocorasick/shared.go#L111): CreateNewState Automaton function for creating a new state 'state'. 11. [`CreateTransition`](./strings/ahocorasick/shared.go#L116): CreateTransition Creates a transition for function σ(state,letter) = end. 12. [`GetParent`](./strings/ahocorasick/shared.go#L99): GetParent Function that finds the first previous state of a state and returns it. Used for trie where there is only one parent. 13. [`GetTransition`](./strings/ahocorasick/shared.go#L121): GetTransition Returns ending state for transition σ(fromState,overChar), '-1' if there is none. 14. [`GetWord`](./strings/ahocorasick/shared.go#L49): GetWord Function that returns word found in text 't' at position range 'begin' to 'end'. 15. [`IntArrayCapUp`](./strings/ahocorasick/shared.go#L70): IntArrayCapUp Dynamically increases an array size of int's by 1. 16. [`StateExists`](./strings/ahocorasick/shared.go#L133): StateExists Checks if state 'state' exists. Returns 'true' if it does, 'false' otherwise. --- ##### Types 1. [`Result`](./strings/ahocorasick/ahocorasick.go#L9): No description provided. ---
armstrong --- ##### Functions: 1. [`IsArmstrong`](./math/armstrong/isarmstrong.go#L14): No description provided. ---
binary --- ##### Package binary describes algorithms that use binary operations for different calculations. --- ##### Functions: 1. [`Abs`](./math/binary/abs.go#L10): 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 variable in bits, for example, for int32 it will be 32, for int64 it will be 64 3) For negative numbers, above step sets mask as 1 1 1 1 1 1 1 1 and 0 0 0 0 0 0 0 0 for positive numbers. 4) Add the mask to the given number. 5) XOR of mask + n and mask gives the absolute value. 2. [`BitCounter`](./math/binary/bitcounter.go#L11): BitCounter - The function returns the number of set bits for an unsigned integer number 3. [`FastInverseSqrt`](./math/binary/fast_inverse_sqrt.go#L15): FastInverseSqrt assumes that argument is always positive, and it does not deal with negative numbers. The "magic" number 0x5f3759df is hex for 1597463007 in decimals. The math.Float32bits is alias to *(*uint32)(unsafe.Pointer(&f)) and math.Float32frombits is to *(*float32)(unsafe.Pointer(&b)). 4. [`IsPowerOfTwo`](./math/binary/checkisnumberpoweroftwo.go#L21): 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 represented like 11...1. Therefore, using the and function: 10...0 & 01...1 00...0 -> 0 This is also true for 0, which is not a power of 2, for which we have to add and extra condition. 5. [`IsPowerOfTwoLeftShift`](./math/binary/checkisnumberpoweroftwo.go#L28): IsPowerOfTwoLeftShift This function takes advantage of the fact that left shifting a number by 1 is equivalent to multiplying by 2. For example, binary 00000001 when shifted by 3 becomes 00001000, which in decimal system is 8 or = 2 * 2 * 2 6. [`LogBase2`](./math/binary/logarithm.go#L7): 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) 7. [`MeanUsingAndXor`](./math/binary/arithmeticmean.go#L12): MeanUsingAndXor This function finds arithmetic mean using "AND" and "XOR" operations 8. [`MeanUsingRightShift`](./math/binary/arithmeticmean.go#L17): MeanUsingRightShift This function finds arithmetic mean using right shift 9. [`ReverseBits`](./math/binary/reversebits.go#L14): ReverseBits This function initialized the result by 0 (all bits 0) and process the given number starting from its least significant bit. If the current bit is 1, set the corresponding most significant bit in the result and finally move on to the next bit in the input number. Repeat this till all its bits are processed. 10. [`SequenceGrayCode`](./math/binary/rbc.go#L11): SequenceGrayCode The function generates an "Gray code" sequence of length n 11. [`Sqrt`](./math/binary/sqrt.go#L10): No description provided. 12. [`XorSearchMissingNumber`](./math/binary/xorsearch.go#L11): XorSearchMissingNumber This function finds a missing number in a sequence ---
cache --- ##### Functions: 1. [`NewLRU`](./cache/lru.go#L22): NewLRU represent initiate lru cache with capacity 2. [`NewLFU`](./cache/lfu.go#L33): NewLFU represent initiate lfu cache with capacity 3. [`Get`](./cache/lfu.go#L52): Get the value by key from LFU cache 4. [`Put`](./cache/lfu.go#L66): Put the key and value in LFU cache --- ##### Types 1. [`LRU`](./cache/lru.go#L15): Default the struct of lru cache algorithm. 2. [`LFU`](./cache/lfu.go#L19): Default the struct of lfu cache algorithm. ---
caesar --- ##### Package caesar is the shift cipher ref: https://en.wikipedia.org/wiki/Caesar_cipher --- ##### Functions: 1. [`Decrypt`](./cipher/caesar/caesar.go#L27): Decrypt decrypts by left shift of "key" each character of "input" 2. [`Encrypt`](./cipher/caesar/caesar.go#L6): Encrypt encrypts by right shift of "key" each character of "input" 3. [`FuzzCaesar`](./cipher/caesar/caesar_test.go#L158): No description provided. ---
catalan --- ##### Functions: 1. [`CatalanNumber`](./math/catalan/catalannumber.go#L16): CatalanNumber This function returns the `nth` Catalan number ---
checksum --- ##### Package checksum describes algorithms for finding various checksums --- ##### Functions: 1. [`CRC8`](./checksum/crc8.go#L25): CRC8 calculates CRC8 checksum of the given data. 2. [`Luhn`](./checksum/luhn.go#L11): Luhn validates the provided data using the Luhn algorithm. --- ##### Types 1. [`CRCModel`](./checksum/crc8.go#L15): No description provided. ---
coloring --- ##### Package coloring provides implementation of different graph coloring algorithms, e.g. coloring using BFS, using Backtracking, using greedy approach. Author(s): [Shivam](https://github.com/Shivam010) --- ##### Functions: 1. [`BipartiteCheck`](./graph/coloring/bipartite.go#L40): basically tries to color the graph in two colors if each edge connects 2 differently colored nodes the graph can be considered bipartite --- ##### Types 1. [`Graph`](./graph/coloring/graph.go#L14): No description provided. ---
combination --- ##### Package combination ... --- ##### Functions: 1. [`Start`](./strings/combination/combination.go#L13): Start ... --- ##### Types 1. [`Combinations`](./strings/combination/combination.go#L7): No description provided. ---
compression --- ##### Functions: 1. [`HuffDecode`](./compression/huffmancoding.go#L104): HuffDecode recursively decodes the binary code in, by traversing the Huffman compression tree pointed by root. current stores the current node of the traversing algorithm. out stores the current decoded string. 2. [`HuffEncode`](./compression/huffmancoding.go#L93): HuffEncode encodes the string in by applying the mapping defined by codes. 3. [`HuffEncoding`](./compression/huffmancoding.go#L76): HuffEncoding recursively traverses the Huffman tree pointed by node to obtain the map codes, that associates a rune with a slice of booleans. Each code is prefixed by prefix and left and right children are labelled with the booleans false and true, respectively. 4. [`HuffTree`](./compression/huffmancoding.go#L33): HuffTree returns the root Node of the Huffman tree by compressing listfreq. The compression produces the most optimal code lengths, provided listfreq is ordered, i.e.: listfreq[i] <= listfreq[j], whenever i < j. --- ##### Types 1. [`Node`](./compression/huffmancoding.go#L17): No description provided. 2. [`SymbolFreq`](./compression/huffmancoding.go#L25): No description provided. ---
compression_test --- ##### Functions: 1. [`SymbolCountOrd`](./compression/huffmancoding_test.go#L16): SymbolCountOrd computes sorted symbol-frequency list of input message ---
conversion --- ##### Package conversion is a package of implementations which converts one data structure to another. --- ##### Functions: 1. [`Base64Decode`](./conversion/base64.go#L57): Base64Decode decodes the received input base64 string into a byte slice. The implementation follows the RFC4648 standard, which is documented at https://datatracker.ietf.org/doc/html/rfc4648#section-4 2. [`Base64Encode`](./conversion/base64.go#L19): Base64Encode encodes the received input bytes slice into a base64 string. The implementation follows the RFC4648 standard, which is documented at https://datatracker.ietf.org/doc/html/rfc4648#section-4 3. [`BinaryToDecimal`](./conversion/binarytodecimal.go#L25): BinaryToDecimal() function that will take Binary number as string, and return it's Decimal equivalent as integer. 4. [`DecimalToBinary`](./conversion/decimaltobinary.go#L32): DecimalToBinary() function that will take Decimal number as int, and return it's Binary equivalent as string. 5. [`FuzzBase64Encode`](./conversion/base64_test.go#L113): No description provided. 6. [`HEXToRGB`](./conversion/rgbhex.go#L10): HEXToRGB splits an RGB input (e.g. a color in hex format; 0x) into the individual components: red, green and blue 7. [`IntToRoman`](./conversion/inttoroman.go#L17): IntToRoman converts an integer value to a roman numeral string. An error is returned if the integer is not between 1 and 3999. 8. [`RGBToHEX`](./conversion/rgbhex.go#L41): RGBToHEX does exactly the opposite of HEXToRGB: it combines the three components red, green and blue to an RGB value, which can be converted to e.g. Hex 9. [`Reverse`](./conversion/decimaltobinary.go#L22): Reverse() function that will take string, and returns the reverse of that string. 10. [`RomanToInt`](./conversion/romantoint.go#L40): 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 string return 0 with no error thrown. ---
deque --- ##### Package deque implements a Double Ended Queue data structure. --- ##### Functions: 1. [`New`](./structure/deque/deque.go#L22): New returns a new DoublyEndedQueue. --- ##### Types 1. [`DoublyEndedQueue`](./structure/deque/deque.go#L17): No description provided. ---
deque_test --- ##### Types 1. [`QueryStructure`](./structure/deque/deque_test.go#L20): No description provided. 2. [`TestCaseData`](./structure/deque/deque_test.go#L27): No description provided. ---
diffiehellman --- ##### Package diffiehellman implements Diffie-Hellman Key Exchange Algorithm for more information watch : https://www.youtube.com/watch?v=NmM9HA2MQGI --- ##### Functions: 1. [`GenerateMutualKey`](./cipher/diffiehellman/diffiehellmankeyexchange.go#L19): GenerateMutualKey : generates a mutual key that can be used by only alice and bob mutualKey = (shareKey^prvKey)%primeNumber 2. [`GenerateShareKey`](./cipher/diffiehellman/diffiehellmankeyexchange.go#L13): GenerateShareKey : generates a key using client private key , generator and primeNumber this key can be made public shareKey = (g^key)%primeNumber ---
dynamic --- ##### Package dynamic is a package of certain implementations of dynamically run algorithms. --- ##### Functions: 1. [`Abbreviation`](./dynamic/abbreviation.go#L24): Returns true if it is possible to make a equals b (if b is an abbreviation of a), returns false otherwise 2. [`Bin2`](./dynamic/binomialcoefficient.go#L21): Bin2 function 3. [`CoinChange`](./dynamic/coinchange.go#L5): CoinChange finds the number of possible combinations of coins of different values which can get to the target amount. 4. [`CutRodDp`](./dynamic/rodcutting.go#L21): CutRodDp solve the same problem using dynamic programming 5. [`CutRodRec`](./dynamic/rodcutting.go#L8): CutRodRec solve the problem recursively: initial approach 6. [`EditDistanceDP`](./dynamic/editdistance.go#L35): EditDistanceDP is an optimised implementation which builds on the ideas of the recursive implementation. We use dynamic programming to compute the DP table where dp[i][j] denotes the edit distance value of first[0..i-1] and second[0..j-1]. Time complexity is O(m * n) where m and n are lengths of the strings, first and second respectively. 7. [`EditDistanceRecursive`](./dynamic/editdistance.go#L10): EditDistanceRecursive is a naive implementation with exponential time complexity. 8. [`IsSubsetSum`](./dynamic/subsetsum.go#L14): No description provided. 9. [`Knapsack`](./dynamic/knapsack.go#L17): Knapsack solves knapsack problem return maxProfit 10. [`LongestCommonSubsequence`](./dynamic/longestcommonsubsequence.go#L13): LongestCommonSubsequence function 11. [`LongestIncreasingSubsequence`](./dynamic/longestincreasingsubsequence.go#L9): LongestIncreasingSubsequence returns the longest increasing subsequence where all elements of the subsequence are sorted in increasing order 12. [`LongestIncreasingSubsequenceGreedy`](./dynamic/longestincreasingsubsequencegreedy.go#L9): LongestIncreasingSubsequenceGreedy is a function to find the longest increasing subsequence in a given array using a greedy approach. The dynamic programming approach is implemented alongside this one. Worst Case Time Complexity: O(nlogn) Auxiliary Space: O(n), where n is the length of the array(slice). Reference: https://www.geeksforgeeks.org/construction-of-longest-monotonically-increasing-subsequence-n-log-n/ 13. [`LpsDp`](./dynamic/longestpalindromicsubsequence.go#L25): LpsDp function 14. [`LpsRec`](./dynamic/longestpalindromicsubsequence.go#L20): LpsRec function 15. [`MatrixChainDp`](./dynamic/matrixmultiplication.go#L24): MatrixChainDp function 16. [`MatrixChainRec`](./dynamic/matrixmultiplication.go#L10): MatrixChainRec function 17. [`Max`](./dynamic/knapsack.go#L11): Max function - possible duplicate 18. [`NthCatalanNumber`](./dynamic/catalan.go#L13): NthCatalan returns the n-th Catalan Number Complexity: O(n²) 19. [`NthFibonacci`](./dynamic/fibonacci.go#L6): NthFibonacci returns the nth Fibonacci Number 20. [`TrapRainWater`](./dynamic/traprainwater.go#L17): Calculate the amount of trapped rainwater between bars represented by an elevation map using dynamic programming. ---
dynamicarray --- ##### Package dynamicarray A dynamic array is quite similar to a regular array, but its Size is modifiable during program runtime, very similar to how a slice in Go works. The implementation is for educational purposes and explains how one might go about implementing their own version of slices. For more details check out those links below here: GeeksForGeeks article : https://www.geeksforgeeks.org/how-do-dynamic-arrays-work/ Go blog: https://blog.golang.org/slices-intro Go blog: https://blog.golang.org/slices authors [Wesllhey Holanda](https://github.com/wesllhey), [Milad](https://github.com/miraddo) see dynamicarray.go, dynamicarray_test.go --- ##### Types 1. [`DynamicArray`](./structure/dynamicarray/dynamicarray.go#L21): No description provided. ---
factorial --- ##### Package factorial describes algorithms Factorials calculations. --- ##### Functions: 1. [`Iterative`](./math/factorial/factorial.go#L12): Iterative returns the iteratively brute forced factorial of n 2. [`Recursive`](./math/factorial/factorial.go#L21): Recursive This function recursively computes the factorial of a number 3. [`UsingTree`](./math/factorial/factorial.go#L30): UsingTree This function finds the factorial of a number using a binary tree ---
fibonacci --- ##### Functions: 1. [`Formula`](./math/fibonacci/fibonacci.go#L42): Formula This function calculates the n-th fibonacci number using the [formula](https://en.wikipedia.org/wiki/Fibonacci_number#Relation_to_the_golden_ratio) Attention! Tests for large values fall due to rounding error of floating point numbers, works well, only on small numbers 2. [`Matrix`](./math/fibonacci/fibonacci.go#L15): Matrix This function calculates the n-th fibonacci number using the matrix method. [See](https://en.wikipedia.org/wiki/Fibonacci_number#Matrix_form) 3. [`Recursive`](./math/fibonacci/fibonacci.go#L51): Recursive calculates the n-th fibonacci number recursively by adding the previous two Fibonacci numbers. This algorithm is extremely slow for bigger numbers, but provides a simpler implementation. ---
gcd --- ##### Functions: 1. [`Extended`](./math/gcd/extended.go#L12): Extended simple extended gcd 2. [`ExtendedIterative`](./math/gcd/extendedgcditerative.go#L4): ExtendedIterative finds and returns gcd(a, b), x, y satisfying a*x + b*y = gcd(a, b). 3. [`ExtendedRecursive`](./math/gcd/extendedgcd.go#L4): ExtendedRecursive finds and returns gcd(a, b), x, y satisfying a*x + b*y = gcd(a, b). 4. [`Iterative`](./math/gcd/gcditerative.go#L4): Iterative Faster iterative version of GcdRecursive without holding up too much of the stack 5. [`Recursive`](./math/gcd/gcd.go#L4): Recursive finds and returns the greatest common divisor of a given integer. 6. [`TemplateBenchmarkExtendedGCD`](./math/gcd/extendedgcd_test.go#L44): No description provided. 7. [`TemplateBenchmarkGCD`](./math/gcd/gcd_test.go#L37): No description provided. 8. [`TemplateTestExtendedGCD`](./math/gcd/extendedgcd_test.go#L7): No description provided. 9. [`TemplateTestGCD`](./math/gcd/gcd_test.go#L18): No description provided. ---
generateparentheses --- ##### Functions: 1. [`GenerateParenthesis`](./strings/generateparentheses/generateparentheses.go#L12): No description provided. ---
genetic --- ##### Package genetic provides functions to work with strings using genetic algorithm. https://en.wikipedia.org/wiki/Genetic_algorithm Author: D4rkia --- ##### Functions: 1. [`GeneticString`](./strings/genetic/genetic.go#L71): GeneticString generates PopulationItem based on the imputed target string, and a set of possible runes to build a string with. In order to optimise string generation additional configurations can be provided with Conf instance. Empty instance of Conf (&Conf{}) can be provided, then default values would be set. Link to the same algorithm implemented in python: https://github.com/TheAlgorithms/Python/blob/master/genetic_algorithm/basic_string.py --- ##### Types 1. [`Conf`](./strings/genetic/genetic.go#L32): No description provided. 2. [`PopulationItem`](./strings/genetic/genetic.go#L26): No description provided. 3. [`Result`](./strings/genetic/genetic.go#L52): No description provided. ---
geometry --- ##### Package geometry contains geometric algorithms Package geometry contains geometric algorithms --- ##### Functions: 1. [`Distance`](./math/geometry/straightlines.go#L18): Distance calculates the shortest distance between two points. 2. [`EuclideanDistance`](./math/geometry/distance.go#L20): EuclideanDistance returns the Euclidean distance between points in any `n` dimensional Euclidean space. 3. [`IsParallel`](./math/geometry/straightlines.go#L42): IsParallel checks if two lines are parallel or not. 4. [`IsPerpendicular`](./math/geometry/straightlines.go#L47): IsPerpendicular checks if two lines are perpendicular or not. 5. [`PointDistance`](./math/geometry/straightlines.go#L53): PointDistance calculates the distance of a given Point from a given line. The slice should contain the coefficiet of x, the coefficient of y and the constant in the respective order. 6. [`Section`](./math/geometry/straightlines.go#L24): 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. 7. [`Slope`](./math/geometry/straightlines.go#L32): Slope calculates the slope (gradient) of a line. 8. [`YIntercept`](./math/geometry/straightlines.go#L37): YIntercept calculates the Y-Intercept of a line from a specific Point. --- ##### Types 1. [`EuclideanPoint`](./math/geometry/distance.go#L14): No description provided. 2. [`Line`](./math/geometry/straightlines.go#L13): No description provided. 3. [`Point`](./math/geometry/straightlines.go#L9): No description provided. ---
graph --- ##### Package graph demonstrates Graph search algorithms reference: https://en.wikipedia.org/wiki/Tree_traversal --- ##### Functions: 1. [`ArticulationPoint`](./graph/articulationpoints.go#L19): ArticulationPoint is a function to identify articulation points in a graph. The function takes the graph as an argument and returns a boolean slice which indicates whether a vertex is an articulation point or not. Worst Case Time Complexity: O(|V| + |E|) Auxiliary Space: O(|V|) reference: https://en.wikipedia.org/wiki/Biconnected_component and https://cptalks.quora.com/Cut-Vertex-Articulation-point 2. [`BreadthFirstSearch`](./graph/breadthfirstsearch.go#L9): BreadthFirstSearch is an algorithm for traversing and searching graph data structures. It starts at an arbitrary node of a graph, and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level. Worst-case performance O(|V|+|E|)=O(b^{d})}O(|V|+|E|)=O(b^{d}) Worst-case space complexity O(|V|)=O(b^{d})}O(|V|)=O(b^{d}) reference: https://en.wikipedia.org/wiki/Breadth-first_search 3. [`DepthFirstSearch`](./graph/depthfirstsearch.go#L53): No description provided. 4. [`DepthFirstSearchHelper`](./graph/depthfirstsearch.go#L21): No description provided. 5. [`FloydWarshall`](./graph/floydwarshall.go#L15): FloydWarshall Returns all pair's shortest path using Floyd Warshall algorithm 6. [`GetIdx`](./graph/depthfirstsearch.go#L3): No description provided. 7. [`KruskalMST`](./graph/kruskal.go#L23): No description provided. 8. [`PrimMST`](./graph/prim.go#30): Computes the minimum spanning tree of a weighted undirected graph 9. [`LowestCommonAncestor`](./graph/lowestcommonancestor.go#L111): 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 the `2^j`-th ancestor above the node `u` with `u` in range `[0, numbersVertex)`, `j` in range `[0,MAXLOG)`. These information allow us to jump from any node to any ancestor above it in `O(MAXLOG)` time. 10. [`New`](./graph/graph.go#L16): Constructor functions for graphs (undirected by default) 11. [`NewTree`](./graph/lowestcommonancestor.go#L84): No description provided. 12. [`NewUnionFind`](./graph/unionfind.go#L24): Initialise a new union find data structure with s nodes 13. [`NotExist`](./graph/depthfirstsearch.go#L12): No description provided. 14. [`Topological`](./graph/topological.go#L7): Topological assumes that graph given is valid and that its possible to get a topological ordering. constraints are array of []int{a, b}, representing an edge going from a to b 15. [`Edmond-Karp`](./graph/edmondkarp.go#L43): Computes the maximum possible flow between a pair of s-t vertices in a weighted graph --- ##### Types 1. [`Edge`](./graph/kruskal.go#L17): No description provided. 2. [`Graph`](./graph/graph.go#L9): No description provided. 3. [`Item`](./graph/dijkstra.go#L5): No description provided. 4. [`Query`](./graph/lowestcommonancestor_test.go#L9): No description provided. 5. [`Tree`](./graph/lowestcommonancestor.go#L25): No description provided. 6. [`TreeEdge`](./graph/lowestcommonancestor.go#L12): No description provided. 7. [`UnionFind`](./graph/unionfind.go#L18): No description provided. 8. [`WeightedGraph`](./graph/floydwarshall.go#L9): No description provided. ---
guid --- ##### Package guid provides facilities for generating random globally unique identifiers. --- ##### Functions: 1. [`New`](./strings/guid/guid.go#L28): New returns a randomly generated global unique identifier. ---
hashmap --- ##### Functions: 1. [`Make`](./structure/hashmap/hashmap.go#L32): Make creates a new HashMap instance with input size and capacity 2. [`New`](./structure/hashmap/hashmap.go#L24): New return new HashMap instance --- ##### Types 1. [`HashMap`](./structure/hashmap/hashmap.go#L17): No description provided. ---
heap --- ##### Functions: 1. [`New`](./structure/heap/heap.go#L15): New gives a new heap object. 2. [`NewAny`](./structure/heap/heap.go#L24): NewAny gives a new heap object. element can be anything, but must provide less function. --- ##### Types 1. [`Heap`](./structure/heap/heap.go#L9): No description provided. ---
heap_test --- ##### Types 1. [`testInt`](#L0): Methods: 1. [`Less`](./structure/heap/heap_test.go#L11): No description provided. 2. [`testStudent`](#L0): Methods: 1. [`Less`](./structure/heap/heap_test.go#L20): No description provided. ---
horspool --- ##### Functions: 1. [`Horspool`](./strings/horspool/horspool.go#L10): No description provided. ---
kmp --- ##### Functions: 1. [`Kmp`](./strings/kmp/kmp.go#L4): Kmp Function kmp performing the Knuth-Morris-Pratt algorithm. --- ##### Types 1. [`args`](./strings/kmp/kmp_test.go#L39): No description provided. ---
lcm --- ##### Functions: 1. [`Lcm`](./math/lcm/lcm.go#L10): Lcm returns the lcm of two numbers using the fact that lcm(a,b) * gcd(a,b) = | a * b | ---
levenshtein --- ##### Functions: 1. [`Distance`](./strings/levenshtein/levenshteindistance.go#L10): Distance Function that gives Levenshtein Distance ---
linkedlist --- ##### Package linkedlist demonstrates different implementations on linkedlists. --- ##### Functions: 1. [`JosephusProblem`](./structure/linkedlist/cyclic.go#L120): https://en.wikipedia.org/wiki/Josephus_problem This is a struct-based solution for Josephus problem. 2. [`NewCyclic`](./structure/linkedlist/cyclic.go#L12): Create new list. 3. [`NewDoubly`](./structure/linkedlist/doubly.go#L31): No description provided. 4. [`NewNode`](./structure/linkedlist/shared.go#L12): Create new node. 5. [`NewSingly`](./structure/linkedlist/singlylinkedlist.go#L19): NewSingly returns a new instance of a linked list --- ##### Types 1. [`Cyclic`](./structure/linkedlist/cyclic.go#L6): No description provided. 2. [`Doubly`](./structure/linkedlist/doubly.go#L18): No description provided. 3. [`Node`](./structure/linkedlist/shared.go#L5): No description provided. 4. [`Singly`](./structure/linkedlist/singlylinkedlist.go#L10): No description provided. 5. [`testCase`](./structure/linkedlist/cyclic_test.go#L105): No description provided. ---
manacher --- ##### Functions: 1. [`LongestPalindrome`](./strings/manacher/longestpalindrome.go#L37): No description provided. ---
math --- ##### Package math is a package that contains mathematical algorithms and its different implementations. filename : krishnamurthy.go description: A program which contains the function that returns true if a given number is Krishnamurthy number or not. details: A number is a Krishnamurthy number if the sum of all the factorials of the digits is equal to the number. Ex: 1! = 1, 145 = 1! + 4! + 5! author(s): [GooMonk](https://github.com/GooMonk) see krishnamurthy_test.go --- ##### Functions: 1. [`Abs`](./math/abs.go#L11): Abs returns absolute value 2. [`AliquotSum`](./math/aliquotsum.go#L14): This function returns s(n) for given number 3. [`Combinations`](./math/binomialcoefficient.go#L20): C is Binomial Coefficient function This function returns C(n, k) for given n and k 4. [`Cos`](./math/cos.go#L10): Cos returns the cosine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine) [Based on the idea of Bhaskara approximation of cos(x)](https://math.stackexchange.com/questions/3886552/bhaskara-approximation-of-cosx) 5. [`DefaultPolynomial`](./math/pollard.go#L16): DefaultPolynomial is the commonly used polynomial g(x) = (x^2 + 1) mod n 6. [`FindKthMax`](./math/kthnumber.go#L11): FindKthMax returns the kth large element given an integer slice with nil `error` if found and returns -1 with `error` `search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process. 7. [`FindKthMin`](./math/kthnumber.go#L19): FindKthMin returns kth small element given an integer slice with nil `error` if found and returns -1 with `error` `search.ErrNotFound` if not found. NOTE: The `nums` slice gets mutated in the process. 8. [`IsAutomorphic`](./math/isautomorphic.go#L16): No description provided. 9. [`IsKrishnamurthyNumber`](./math/krishnamurthy.go#L12): IsKrishnamurthyNumber returns if the provided number n is a Krishnamurthy number or not. 10. [`IsPerfectNumber`](./math/perfectnumber.go#L34): Checks if inNumber is a perfect number 11. [`IsPowOfTwoUseLog`](./math/checkisnumberpoweroftwo.go#L10): 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 the binary package. 12. [`Lerp`](./math/lerp.go#L5): Lerp or Linear interpolation This function will return new value in 't' percentage between 'v0' and 'v1' 13. [`LiouvilleLambda`](./math/liouville.go#L24): Lambda is the liouville function This function returns λ(n) for given number 14. [`Mean`](./math/mean.go#L7): No description provided. 15. [`Median`](./math/median.go#L12): No description provided. 16. [`Mode`](./math/mode.go#L19): No description provided. 17. [`Mu`](./math/mobius.go#L21): Mu is the Mobius function This function returns μ(n) for given number 18. [`Phi`](./math/eulertotient.go#L5): Phi is the Euler totient function. This function computes the number of numbers less then n that are coprime with n. 19. [`PollardsRhoFactorization`](./math/pollard.go#L29): PollardsRhoFactorization is an implementation of Pollard's rho factorization algorithm using the default parameters x = y = 2 20. [`PronicNumber`](./math/pronicnumber.go#L15): PronicNumber returns true if argument passed to the function is pronic and false otherwise. 21. [`Sin`](./math/sin.go#L9): Sin returns the sine of the radian argument x. [See more](https://en.wikipedia.org/wiki/Sine_and_cosine) 22. [`SumOfProperDivisors`](./math/perfectnumber.go#L17): Returns the sum of proper divisors of inNumber. ---
matrix --- ##### filename: strassenmatrixmultiply.go description: Implements matrix multiplication using the Strassen algorithm. details: This program takes two matrices as input and performs matrix multiplication using the Strassen algorithm, which is an optimized divide-and-conquer approach. It allows for efficient multiplication of large matrices. author(s): Mohit Raghav(https://github.com/mohit07raghav19) See strassenmatrixmultiply_test.go for test cases --- ##### Functions: 1. [`IsValid`](./math/matrix/isvalid.go#L6): IsValid checks if the input matrix has consistent row lengths. 2. [`New`](./math/matrix/matrix.go#L17): NewMatrix creates a new Matrix based on the provided arguments. 3. [`NewFromElements`](./math/matrix/matrix.go#L43): NewFromElements creates a new Matrix from the given elements. --- ##### Types 1. [`Matrix`](./math/matrix/matrix.go#L10): No description provided. ---
matrix_test --- ##### Functions: 1. [`MakeRandomMatrix`](./math/matrix/strassenmatrixmultiply_test.go#L105): No description provided. ---
max --- ##### Functions: 1. [`Bitwise`](./math/max/bitwisemax.go#L11): Bitwise computes using bitwise operator the maximum of all the integer input and returns it 2. [`Int`](./math/max/max.go#L6): Int is a function which returns the maximum of all the integers provided as arguments. ---
maxsubarraysum --- ##### Package maxsubarraysum is a package containing a solution to a common problem of finding max contiguous sum within a array of ints. --- ##### Functions: 1. [`MaxSubarraySum`](./other/maxsubarraysum/maxsubarraysum.go#L13): MaxSubarraySum returns the maximum subarray sum ---
min --- ##### Functions: 1. [`Bitwise`](./math/min/bitwisemin.go#L11): Bitwise This function returns the minimum integer using bit operations 2. [`Int`](./math/min/min.go#L6): Int is a function which returns the minimum of all the integers provided as arguments. ---
modular --- ##### Functions: 1. [`Exponentiation`](./math/modular/exponentiation.go#L22): Exponentiation returns base^exponent % mod 2. [`Inverse`](./math/modular/inverse.go#L19): Inverse Modular function 3. [`Multiply64BitInt`](./math/modular/exponentiation.go#L51): Multiply64BitInt Checking if the integer multiplication overflows ---
moserdebruijnsequence --- ##### Functions: 1. [`MoserDeBruijnSequence`](./math/moserdebruijnsequence/sequence.go#L7): No description provided. ---
nested --- ##### Package nested provides functions for testing strings proper brackets nesting. --- ##### Functions: 1. [`IsBalanced`](./other/nested/nestedbrackets.go#L20): IsBalanced returns true if provided input string is properly nested. Input is a sequence of brackets: '(', ')', '[', ']', '{', '}'. A sequence of brackets `s` is considered properly nested if any of the following conditions are true: - `s` is empty; - `s` has the form (U) or [U] or {U} where U is a properly nested string; - `s` has the form VW where V and W are properly nested strings. For example, the string "()()[()]" is properly nested but "[(()]" is not. **Note** Providing characters other then brackets would return false, despite brackets sequence in the string. Make sure to filter input before usage. ---
palindrome --- ##### Functions: 1. [`IsPalindrome`](./strings/palindrome/ispalindrome.go#L26): No description provided. 2. [`IsPalindromeRecursive`](./strings/palindrome/ispalindrome.go#L39): No description provided. ---
pangram --- ##### Functions: 1. [`IsPangram`](./strings/pangram/ispangram.go#L21): No description provided. ---
parenthesis --- ##### Functions: 1. [`Parenthesis`](./strings/parenthesis/parenthesis.go#L8): Parenthesis algorithm checks if every opened parenthesis is closed correctly. When parcounter is less than 0 when a closing parenthesis is detected without an opening parenthesis that surrounds it and parcounter will be 0 if all open parenthesis are closed correctly. ---
pascal --- ##### Functions: 1. [`GenerateTriangle`](./math/pascal/pascaltriangle.go#L24): GenerateTriangle This function generates a Pascal's triangle of n lines ---
password --- ##### Package password contains functions to help generate random passwords --- ##### Functions: 1. [`Generate`](./other/password/generator.go#L15): Generate returns a newly generated password ---
permutation --- ##### Functions: 1. [`GenerateElementSet`](./math/permutation/heaps.go#L37): No description provided. 2. [`Heaps`](./math/permutation/heaps.go#L8): Heap's Algorithm for generating all permutations of n objects 3. [`NextPermutation`](./math/permutation/next_permutation.go#8): A solution to find next permutation of an integer array in constant memory ---
pi --- ##### spigotpi_test.go description: Test for Spigot Algorithm for the Digits of Pi author(s) [red_byte](https://github.com/i-redbyte) see spigotpi.go --- ##### Functions: 1. [`MonteCarloPi`](./math/pi/montecarlopi.go#L17): No description provided. 2. [`MonteCarloPiConcurrent`](./math/pi/montecarlopi.go#L36): MonteCarloPiConcurrent approximates the value of pi using the Monte Carlo method. Unlike the MonteCarloPi function (first version), this implementation uses goroutines and channels to parallelize the computation. More details on the Monte Carlo method available at https://en.wikipedia.org/wiki/Monte_Carlo_method. More details on goroutines parallelization available at https://go.dev/doc/effective_go#parallel. 3. [`Spigot`](./math/pi/spigotpi.go#L12): No description provided. ---
polybius --- ##### Package polybius is encrypting method with polybius square ref: https://en.wikipedia.org/wiki/Polybius_square#Hybrid_Polybius_Playfair_Cipher --- ##### Functions: 1. [`FuzzPolybius`](./cipher/polybius/polybius_test.go#L154): No description provided. 2. [`NewPolybius`](./cipher/polybius/polybius.go#L21): NewPolybius returns a pointer to object of Polybius. If the size of "chars" is longer than "size", "chars" are truncated to "size". --- ##### Types 1. [`Polybius`](./cipher/polybius/polybius.go#L12): No description provided. ---
power --- ##### Functions: 1. [`IterativePower`](./math/power/fastexponent.go#L4): IterativePower is iterative O(logn) function for pow(x, y) 2. [`RecursivePower`](./math/power/fastexponent.go#L18): RecursivePower is recursive O(logn) function for pow(x, y) 3. [`RecursivePower1`](./math/power/fastexponent.go#L30): RecursivePower1 is recursive O(n) function for pow(x, y) 4. [`UsingLog`](./math/power/powvialogarithm.go#L14): No description provided. ---
prime --- ##### Functions: 1. [`Factorize`](./math/prime/primefactorization.go#L5): Factorize is a function that computes the exponents of each prime in the prime factorization of n 2. [`Generate`](./math/prime/sieve.go#L26): Generate returns a int slice of prime numbers up to the limit 3. [`GenerateChannel`](./math/prime/sieve.go#L9): Generate generates the sequence of integers starting at 2 and sends it to the channel `ch` 4. [`MillerRabinDeterministic`](./math/prime/millerrabintest.go#L121): MillerRabinDeterministic is a Deterministic version of the Miller-Rabin test, which returns correct results for all valid int64 numbers. 5. [`MillerRabinProbabilistic`](./math/prime/millerrabintest.go#L101): MillerRabinProbabilistic is a probabilistic test for primality of an integer based of the algorithm devised by Miller and Rabin. 6. [`MillerRandomTest`](./math/prime/millerrabintest.go#L77): MillerRandomTest This is the intermediate step that repeats within the miller rabin primality test for better probabilitic chances of receiving the correct result with random witnesses. 7. [`MillerTest`](./math/prime/millerrabintest.go#L49): 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 8. [`MillerTestMultiple`](./math/prime/millerrabintest.go#L84): MillerTestMultiple is like MillerTest but runs the test for multiple witnesses. 9. [`OptimizedTrialDivision`](./math/prime/primecheck.go#L26): OptimizedTrialDivision checks primality of an integer using an optimized trial division method. The optimizations include not checking divisibility by the even numbers and only checking up to the square root of the given number. 10. [`Sieve`](./math/prime/sieve.go#L16): Sieve Sieving the numbers that are not prime from the channel - basically removing them from the channels 11. [`TrialDivision`](./math/prime/primecheck.go#L9): TrialDivision tests whether a number is prime by trying to divide it by the numbers less than it. 12. [`Twin`](./math/prime/twin.go#L15): This function returns twin prime for given number returns (n + 2) if both n and (n + 2) are prime -1 otherwise ---
pythagoras --- ##### Functions: 1. [`Distance`](./math/pythagoras/pythagoras.go#L15): Distance calculates the distance between to vectors with the Pythagoras theorem --- ##### Types 1. [`Vector`](./math/pythagoras/pythagoras.go#L8): No description provided. ---
queue --- ##### Functions: 1. [`BackQueue`](./structure/queue/queuearray.go#L32): BackQueue return the Back value 2. [`DeQueue`](./structure/queue/queuearray.go#L20): DeQueue it will be removed the first value that added into the list 3. [`EnQueue`](./structure/queue/queuearray.go#L15): EnQueue it will be added new value into our list 4. [`FrontQueue`](./structure/queue/queuearray.go#L27): FrontQueue return the Front value 5. [`IsEmptyQueue`](./structure/queue/queuearray.go#L42): IsEmptyQueue check our list is empty or not 6. [`LenQueue`](./structure/queue/queuearray.go#L37): LenQueue will return the length of the queue list --- ##### Types 1. [`LQueue`](./structure/queue/queuelinklistwithlist.go#L20): No description provided. 2. [`Node`](./structure/queue/queuelinkedlist.go#L13): No description provided. 3. [`Queue`](./structure/queue/queuelinkedlist.go#L19): No description provided. ---
rot13 --- ##### Package rot13 is a simple letter substitution cipher that replaces a letter with the 13th letter after it in the alphabet. ref: https://en.wikipedia.org/wiki/ROT13 --- ##### Functions: 1. [`FuzzRot13`](./cipher/rot13/rot13_test.go#L72): No description provided. ---
rsa --- ##### Package rsa shows a simple implementation of RSA algorithm --- ##### Functions: 1. [`Decrypt`](./cipher/rsa/rsa.go#L43): Decrypt decrypts encrypted rune slice based on the RSA algorithm 2. [`Encrypt`](./cipher/rsa/rsa.go#L28): Encrypt encrypts based on the RSA algorithm - uses modular exponentitation in math directory 3. [`FuzzRsa`](./cipher/rsa/rsa_test.go#L79): No description provided. ---
search --- ##### Functions: 1. [`BoyerMoore`](./strings/search/boyermoore.go#L5): Implementation of boyer moore string search O(l) where l=len(text) 2. [`Naive`](./strings/search/naive.go#L5): Implementation of naive string search O(n*m) where n=len(txt) and m=len(pattern) ---
segmenttree --- ##### Functions: 1. [`NewSegmentTree`](./structure/segmenttree/segmenttree.go#L116): No description provided. --- ##### Types 1. [`SegmentTree`](./structure/segmenttree/segmenttree.go#L17): No description provided. ---
set --- ##### package set implements a Set using a golang map. This implies that only the types that are accepted as valid map keys can be used as set elements. For instance, do not try to Add a slice, or the program will panic. --- ##### Functions: 1. [`New`](./structure/set/set.go#L7): New gives new set. ---
sha256 --- ##### Functions: 1. [`Hash`](./hashing/sha256/sha256.go#L50): Hash hashes the input message using the sha256 hashing function, and return a 32 byte array. The implementation follows the RGC6234 standard, which is documented at https://datatracker.ietf.org/doc/html/rfc6234 ---
sort --- ##### Package sort a package for demonstrating sorting algorithms in Go --- ##### Functions: 1. [`BinaryInsertion`](./sort/binaryinsertionsort.go#L13): No description provided. 2. [`Bogo`](./sort/bogosort.go#L32): No description provided. 3. [`Bubble`](./sort/bubblesort.go#L9): Bubble is a simple generic definition of Bubble sort algorithm. 4. [`Bucket`](./sort/bucketsort.go#L7): Bucket sorts a slice. It is mainly useful when input is uniformly distributed over a range. 5. [`Cocktail`](./sort/cocktailsort.go#L9): Cocktail sort is a variation of bubble sort, operating in two directions (beginning to end, end to beginning) 6. [`Comb`](./sort/combSort.go#L17): Comb is a simple sorting algorithm which is an improvement of the bubble sorting algorithm. 7. [`Count`](./sort/countingsort.go#L11): No description provided. 8. [`Cycle`](./sort/cyclesort.go#L10): Cycle sort is an in-place, unstable sorting algorithm that is particularly useful when sorting arrays containing elements with a small range of values. It is theoretically optimal in terms of the total number of writes to the original array. 9. [`Exchange`](./sort/exchangesort.go#L8): No description provided. 10. [`HeapSort`](./sort/heapsort.go#L116): No description provided. 11. [`ImprovedSimple`](./sort/simplesort.go#L27): ImprovedSimple is a improve SimpleSort by skipping an unnecessary comparison of the first and last. This improved version is more similar to implementation of insertion sort 12. [`Insertion`](./sort/insertionsort.go#L5): No description provided. 13. [`Merge`](./sort/mergesort.go#L41): Merge Perform merge sort on a slice 14. [`MergeIter`](./sort/mergesort.go#L55): No description provided. 15. [`Pancake`](./sort/pancakesort.go#L8): Pancake sorts a slice using flip operations, where flip refers to the idea of reversing the slice from index `0` to `i`. 16. [`ParallelMerge`](./sort/mergesort.go#L66): ParallelMerge Perform merge sort on a slice using goroutines 17. [`Partition`](./sort/quicksort.go#L12): No description provided. 18. [`Patience`](./sort/patiencesort.go#L13): No description provided. 19. [`Pigeonhole`](./sort/pigeonholesort.go#L15): Pigeonhole sorts a slice using pigeonhole sorting algorithm. NOTE: To maintain time complexity O(n + N), this is the reason for having only Integer constraint instead of Ordered. 20. [`Quicksort`](./sort/quicksort.go#L39): Quicksort Sorts the entire array 21. [`QuicksortRange`](./sort/quicksort.go#L26): QuicksortRange Sorts the specified range within the array 22. [`RadixSort`](./sort/radixsort.go#L43): No description provided. 23. [`Selection`](./sort/selectionsort.go#L5): No description provided. 24. [`Shell`](./sort/shellsort.go#L5): No description provided. 25. [`Simple`](./sort/simplesort.go#L13): No description provided. --- ##### Types 1. [`MaxHeap`](./sort/heapsort.go#L5): No description provided. ---
sqrt --- ##### Package sqrt contains algorithms and data structures that contains a √n in their complexity --- ##### Functions: 1. [`NewSqrtDecomposition`](./sqrt/sqrtdecomposition.go#L34): Create a new SqrtDecomposition instance with the parameters as specified by SqrtDecomposition comment Assumptions: - len(elements) > 0 --- ##### Types 1. [`SqrtDecomposition`](./sqrt/sqrtdecomposition.go#L21): No description provided. ---
stack --- ##### Functions: 1. [`NewStack`](./structure/stack/stackarray.go#L17): NewStack creates and returns a new stack. --- ##### Types 1. [`Array`](./structure/stack/stackarray.go#L12): No description provided. 2. [`Node`](./structure/stack/stacklinkedlist.go#L13): No description provided. 3. [`SList`](./structure/stack/stacklinkedlistwithlist.go#L18): No description provided. 4. [`Stack`](./structure/stack/stacklinkedlist.go#L19): No description provided. ---
strings --- ##### Package strings is a package that contains all algorithms that are used to analyse and manipulate strings. --- ##### Functions: 1. [`CountChars`](./strings/charoccurrence.go#L12): CountChars counts the number of a times a character has occurred in the provided string argument and returns a map with `rune` as keys and the count as value. 2. [`IsIsogram`](./strings/isisogram.go#L34): No description provided. 3. [`IsSubsequence`](./strings/issubsequence.go#L10): Returns true if s is subsequence of t, otherwise return false. ---
transposition --- ##### Functions: 1. [`Decrypt`](./cipher/transposition/transposition.go#L81): No description provided. 2. [`Encrypt`](./cipher/transposition/transposition.go#L51): No description provided. 3. [`FuzzTransposition`](./cipher/transposition/transposition_test.go#L103): No description provided. ---
tree --- ##### For more details check out those links below here: Wikipedia article: https://en.wikipedia.org/wiki/Binary_search_tree authors [guuzaa](https://github.com/guuzaa) --- ##### Functions: 1. [`NewAVL`](./structure/tree/avl.go#L54): NewAVL creates a novel AVL tree 2. [`NewBinarySearch`](./structure/tree/bstree.go#L46): NewBinarySearch creates a novel Binary-Search tree 3. [`NewRB`](./structure/tree/rbtree.go#L57): NewRB creates a new Red-Black Tree --- ##### Types 1. [`AVL`](./structure/tree/avl.go#L48): No description provided. 2. [`AVLNode`](./structure/tree/avl.go#L18): No description provided. 3. [`BSNode`](./structure/tree/bstree.go#L15): No description provided. 4. [`BinarySearch`](./structure/tree/bstree.go#L40): No description provided. 5. [`RB`](./structure/tree/rbtree.go#L51): No description provided. 6. [`RBNode`](./structure/tree/rbtree.go#L25): No description provided. ---
trie --- ##### Package trie provides Trie data structures in golang. Wikipedia: https://en.wikipedia.org/wiki/Trie --- ##### Functions: 1. [`NewNode`](./structure/trie/trie.go#L14): NewNode creates a new Trie node with initialized children map. --- ##### Types 1. [`Node`](./structure/trie/trie.go#L7): No description provided. ---
xor --- ##### Package xor is an encryption algorithm that operates the exclusive disjunction(XOR) ref: https://en.wikipedia.org/wiki/XOR_cipher --- ##### Functions: 1. [`Decrypt`](./cipher/xor/xor.go#L19): Decrypt decrypts with Xor encryption 2. [`Encrypt`](./cipher/xor/xor.go#L10): Encrypt encrypts with Xor encryption after converting each character to byte The returned value might not be readable because there is no guarantee which is within the ASCII range If using other type such as string, []int, or some other types, add the statements for converting the type to []byte. 3. [`FuzzXOR`](./cipher/xor/xor_test.go#L108): No description provided. ---
Package rail fence is a classical type of transposition cipher ref : https://en.wikipedia.org/wiki/Rail_fence_cipher

Functions:
  1. Encrypt: Encrypt encrypts a message using rail fence cipher
  2. Decrypt: decrypt decrypts a message using rail fence cipher
  3. TestEncrypt Test function for Encrypt
  4. TestDecrypt Test function for Decrypt