@@ -44,22 +44,26 @@ This is a collection of algorithms and data structures which I've implement over
44
44
* [ Hash Array Mapped Trie (HAMT)] ( src/com/jwetherell/algorithms/data_structures/HashArrayMappedTrie.java )
45
45
* [ Hash Map (associative array)] ( src/com/jwetherell/algorithms/data_structures/HashMap.java )
46
46
* [ Interval Tree] ( src/com/jwetherell/algorithms/data_structures/IntervalTree.java )
47
- * [ Implicit Key Treap] ( ( src/com/jwetherell/algorithms/data_structures/ImplicitKeyTreap.java) )
47
+ * [ Implicit Key Treap] ( src/com/jwetherell/algorithms/data_structures/ImplicitKeyTreap.java )
48
48
* [ KD Tree (k-dimensional tree or k-d tree)] ( src/com/jwetherell/algorithms/data_structures/KDTree.java )
49
- * [ List [ backed by an array or a linked list]] ( (src/com/jwetherell/algorithms/data_structures/List.java) )
49
+ * [ List [ backed by an array or a linked list]] ( src/com/jwetherell/algorithms/data_structures/List.java )
50
+ * [ LCP Array (Longest Common Prefix) [ backed by a Suffix Array]] ( src/com/jwetherell/algorithms/data_structures/LCPArray.java )
50
51
* [ Matrix] ( src/com/jwetherell/algorithms/data_structures/Matrix.java )
51
52
* [ Patricia Trie] ( src/com/jwetherell/algorithms/data_structures/PatriciaTrie.java )
52
53
* [ Quad-Tree (Point-Region or MX-CIF)] ( src/com/jwetherell/algorithms/data_structures/QuadTree.java )
53
54
* [ Queue [ backed by an array or a linked list]] ( src/com/jwetherell/algorithms/data_structures/Queue.java )
54
- * [ Radix Trie (associative array) [ backed by a Patricia Trie]] ( src/com/jwetherell/algorithms/data_structures/RadixTree .java )
55
+ * [ Radix Trie (associative array) [ backed by a Patricia Trie]] ( src/com/jwetherell/algorithms/data_structures/RadixTrie .java )
55
56
* [ Red-Black Tree] ( src/com/jwetherell/algorithms/data_structures/RedBlackTree.java )
56
57
* [ Segment Tree] ( src/com/jwetherell/algorithms/data_structures/SegmentTree.java )
57
58
* [ Skip List] ( src/com/jwetherell/algorithms/data_structures/SkipList.java )
58
59
* [ Splay Tree] ( src/com/jwetherell/algorithms/data_structures/SplayTree.java )
59
60
* [ Stack [ backed by an array or a linked list]] ( src/com/jwetherell/algorithms/data_structures/Stack.java )
61
+ * [ Suffix Array] ( src/com/jwetherell/algorithms/data_structures/SuffixArray.java )
60
62
* [ Suffix Tree (Ukkonen's algorithm)] ( src/com/jwetherell/algorithms/data_structures/SuffixTree.java )
61
- * [ Suffix Trie [ backed by a Trie]] ( src/com/jwetherell/algorithms/data_structures/SufficTrie.java )
63
+ * [ Suffix Trie [ backed by a Trie]] ( src/com/jwetherell/algorithms/data_structures/SuffixTrie.java )
64
+ * [ Ternary Search Tree] ( src/com/jwetherell/algorithms/data_structures/TernarySearchTree.java )
62
65
* [ Treap] ( src/com/jwetherell/algorithms/data_structures/Treap.java )
66
+ * [ Tree] ( src/com/jwetherell/algorithms/data_structures/Tree.java )
63
67
* [ Tree Map (associative array) [ backed by an AVL Tree]] ( src/com/jwetherell/algorithms/data_structures/TreeMap.java )
64
68
* [ Trie] ( src/com/jwetherell/algorithms/data_structures/Trie.java )
65
69
* [ Trie Map (associative array) [ backed by a Trie]] ( src/com/jwetherell/algorithms/data_structures/TrieMap.java )
@@ -80,10 +84,15 @@ This is a collection of algorithms and data structures which I've implement over
80
84
+ using only shifts
81
85
+ using logarithms
82
86
+ [ Fast Fourier Transform] ( src/com/jwetherell/algorithms/mathematics/FastFourierTransform.java )
87
+ * [ Exponentiation] ( src/com/jwetherell/algorithms/mathematics/Exponentiation.java )
88
+ + recursive exponentiation
89
+ + fast recursive exponentiation
90
+ + fast modular recursive exponentiation
83
91
* [ Primes] ( src/com/jwetherell/algorithms/mathematics/Primes.java )
84
92
+ is prime
85
93
+ prime factorization
86
94
+ sieve of eratosthenes
95
+ + Miller-Rabin test
87
96
+ [ Co-Primes (relatively prime, mutually prime)] ( src/com/jwetherell/algorithms/mathematics/Coprimes.java )
88
97
+ [ Greatest Common Divisor] ( src/com/jwetherell/algorithms/mathematics/GreatestCommonDivisor.java )
89
98
- using Euclid's algorithm
@@ -145,43 +154,47 @@ This is a collection of algorithms and data structures which I've implement over
145
154
* Graph Traversal
146
155
- [ Depth First Traversal] ( src/com/jwetherell/algorithms/graph/DepthFirstTraversal.java )
147
156
- [ Breadth First Traversal] ( src/com/jwetherell/algorithms/graph/BreadthFirstTraversal.java )
148
- * [ Edmonds Karp] ( src/com/jwetherell/algorithms/graph/EdmondsKarp.java )
157
+ * [ Edmonds Karp] ( src/com/jwetherell/algorithms/graph/EdmondsKarp.java )
158
+ * Matching
159
+ - [ Turbo Matching] ( src/com/jwetherell/algorithms/graph/TurboMatching.java )
160
+ * [ Lowest common ancestor in tree] ( src/com/jwetherell/algorithms/data_structures/Tree.java )
161
+
149
162
150
163
## Search
151
164
* Get index of value in array
152
- + [ Linear] ( src/com/jwetherell/algorithms/Sequences /LinearSearch.java )
153
- + [ Quickselect] ( src/com/jwetherell/algorithms/Sequences /QuickSelect.java )
154
- + [ Binary [ sorted array input only]] ( src/com/jwetherell/algorithms/Sequences /BinarySearch.java )
155
- + [ Lower bound [ sorted array input only]] ( src/com/jwetherell/algorithms/Sequences/LpperBound .java )
156
- + [ Upper bound [ sorted array input only]] ( src/com/jwetherell/algorithms/Sequences /UpperBound.java )
165
+ + [ Linear] ( src/com/jwetherell/algorithms/search /LinearSearch.java )
166
+ + [ Quickselect] ( src/com/jwetherell/algorithms/search /QuickSelect.java )
167
+ + [ Binary [ sorted array input only]] ( src/com/jwetherell/algorithms/search /BinarySearch.java )
168
+ + [ Lower bound [ sorted array input only]] ( src/com/jwetherell/algorithms/search/LowerBound .java )
169
+ + [ Upper bound [ sorted array input only]] ( src/com/jwetherell/algorithms/search /UpperBound.java )
157
170
+ Optimized binary (binary until a threashold then linear) [ sorted array input only]
158
- + [ Interpolation [ sorted array input only]] ( src/com/jwetherell/algorithms/Sequences /InterpolationSearch.java )
171
+ + [ Interpolation [ sorted array input only]] ( src/com/jwetherell/algorithms/search /InterpolationSearch.java )
159
172
160
173
## Sequences
161
- * [ Find longest common subsequence (dynamic programming)] ( src/com/jwetherell/algorithms/Sequences /LongestCommonSubsequence.java )
162
- * [ Find longest increasing subsequence (dynamic programming)] ( src/com/jwetherell/algorithms/Sequences /LongestIncreasingSubsequence.java )
163
- * [ Find number of times a subsequence occurs in a sequence (dynamic programming)] ( src/com/jwetherell/algorithms/Sequences /SubsequenceCounter.java )
164
- * [ Find i-th element in a Fibonacci sequence] ( src/com/jwetherell/algorithms/Sequences /FibonacciSequence.java )
174
+ * [ Find longest common subsequence (dynamic programming)] ( src/com/jwetherell/algorithms/sequence /LongestCommonSubsequence.java )
175
+ * [ Find longest increasing subsequence (dynamic programming)] ( src/com/jwetherell/algorithms/sequence /LongestIncreasingSubsequence.java )
176
+ * [ Find number of times a subsequence occurs in a sequence (dynamic programming)] ( src/com/jwetherell/algorithms/sequence /SubsequenceCounter.java )
177
+ * [ Find i-th element in a Fibonacci sequence] ( src/com/jwetherell/algorithms/sequence /FibonacciSequence.java )
165
178
+ using a loop
166
179
+ using recursion
167
180
+ using matrix multiplication
168
181
+ using Binet's formula
169
- * [ Find total of all elements in a sequence(Arithmetic Progression)] ( src/com/jwetherell/algorithms/Sequences /ArithmeticProgression.java )
182
+ * [ Find total of all elements in a sequence(Arithmetic Progression)] ( src/com/jwetherell/algorithms/sequence /ArithmeticProgression.java )
170
183
+ using a loop
171
184
+ using Triangular numbers
172
- * [ Largest sum of contiguous subarray (Kadane's algorithm)] ( src/com/jwetherell/algorithms/Sequences /LargestSumContiguousSubarray.java )
173
- * [ Longest palindromic subsequence (dynamic programming)] ( src/com/jwetherell/algorithms/Sequences/LongestPalindromicSubsequence .java )
185
+ * [ Largest sum of contiguous subarray (Kadane's algorithm)] ( src/com/jwetherell/algorithms/sequence /LargestSumContiguousSubarray.java )
186
+ * [ Longest palindromic subsequence (dynamic programming)] ( src/com/jwetherell/algorithms/sequence/LongestPalindromicSubsequence .java )
174
187
175
188
## Sorts
176
- * [ American Flag Sort] ( src/com/jwetherell/algorithms/Sorts /AmericanFlagSort.java )
177
- * [ Bubble Sort] ( src/com/jwetherell/algorithms/Sorts /BubbleSort.java )
178
- * [ Counting Sort (Integers only)] ( src/com/jwetherell/algorithms/Sorts /CountingSort.java )
179
- * [ Heap Sort] ( src/com/jwetherell/algorithms/Sorts /HeapSort.java )
180
- * [ Insertion Sort] ( src/com/jwetherell/algorithms/Sorts /InsertionSort.java )
181
- * [ Merge Sort] ( src/com/jwetherell/algorithms/Sorts/AMergeSort .java )
182
- * [ Quick Sort] ( src/com/jwetherell/algorithms/Sorts /QuickSort.java )
183
- * [ Radix Sort (Integers only)] ( src/com/jwetherell/algorithms/Sorts /RadixSort.java )
184
- * [ Shell's Sort] ( src/com/jwetherell/algorithms/Sorts /ShellSort.java )
189
+ * [ American Flag Sort] ( src/com/jwetherell/algorithms/sorts /AmericanFlagSort.java )
190
+ * [ Bubble Sort] ( src/com/jwetherell/algorithms/sorts /BubbleSort.java )
191
+ * [ Counting Sort (Integers only)] ( src/com/jwetherell/algorithms/sorts /CountingSort.java )
192
+ * [ Heap Sort] ( src/com/jwetherell/algorithms/sorts /HeapSort.java )
193
+ * [ Insertion Sort] ( src/com/jwetherell/algorithms/sorts /InsertionSort.java )
194
+ * [ Merge Sort] ( src/com/jwetherell/algorithms/sorts/MergeSort .java )
195
+ * [ Quick Sort] ( src/com/jwetherell/algorithms/sorts /QuickSort.java )
196
+ * [ Radix Sort (Integers only)] ( src/com/jwetherell/algorithms/sorts /RadixSort.java )
197
+ * [ Shell's Sort] ( src/com/jwetherell/algorithms/sorts /ShellSort.java )
185
198
186
199
## String Functions
187
200
### [ String Functions] ( src/com/jwetherell/algorithms/strings/StringFunctions.java )
@@ -198,9 +211,10 @@ This is a collection of algorithms and data structures which I've implement over
198
211
+ using additional storage (a StringBuilder)
199
212
+ using in-place symetric element compares
200
213
* Subsets of characters in a String
201
- * Edit (Levenshtein) Distance of two Strings
202
- * [ KMP (Knuth–Morris–Pratt) Algorithm - Length of maximal prefix-suffix for each prefix] ( src/com/jwetherell/algorithms/strings/KnuthMorrisPratt.java )
203
- * [ String rotations] ( src/com/jwetherell/algorithms/strings/Rotation.java )
204
- + Findin lexicographically minimal string rotation
205
- + Findin lexicographically maximal string rotation
214
+ * Edit (Levenshtein) Distance of two Strings (Recursive, Iterative)
215
+ ### [ Manacher's algorithm (Find the longest Palindrome)] ( src/com/jwetherell/algorithms/strings/Manacher.java )
216
+ ### [ KMP (Knuth–Morris–Pratt) Algorithm - Length of maximal prefix-suffix for each prefix] ( src/com/jwetherell/algorithms/strings/KnuthMorrisPratt.java )
217
+ ### [ String rotations] ( src/com/jwetherell/algorithms/strings/Rotation.java )
218
+ + Find in lexicographically minimal string rotation
219
+ + Find in lexicographically maximal string rotation
206
220
0 commit comments