From d428afeffd5edc58134b7409dc3acba3fd663237 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 15:21:27 +0900 Subject: [PATCH 1/8] Fixed Param of Comment --- src/com/jwetherell/algorithms/data_structures/BTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BTree.java b/src/com/jwetherell/algorithms/data_structures/BTree.java index d15d398c..d930076b 100644 --- a/src/com/jwetherell/algorithms/data_structures/BTree.java +++ b/src/com/jwetherell/algorithms/data_structures/BTree.java @@ -109,7 +109,7 @@ public boolean add(T value) { /** * The node's key size is greater than maxKeySize, split down the middle. * - * @param node + * @param nodeToSplit * to split. */ private void split(Node nodeToSplit) { From 3126082cae851e3a685fc315947f2af033c89444 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 15:50:11 +0900 Subject: [PATCH 2/8] Fixed param of Comment in getDirenctions --- src/com/jwetherell/algorithms/data_structures/BinaryHeap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java index 61f38a16..1b876f36 100644 --- a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java +++ b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java @@ -449,8 +449,8 @@ public int size() { /** * Get the navigation directions through the tree to the index. * - * @param index - * of the Node to get directions for. + * @param idx + * index of the Node to get directions for. * @return Integer array representing the directions to the index. */ private static int[] getDirections(int idx) { From 5dc01d3cbe888b9257d34e33daa1c179bec159b6 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 15:50:43 +0900 Subject: [PATCH 3/8] Fixed param of Comment in validateNode --- src/com/jwetherell/algorithms/data_structures/BinaryHeap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java index 1b876f36..81932349 100644 --- a/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java +++ b/src/com/jwetherell/algorithms/data_structures/BinaryHeap.java @@ -289,8 +289,8 @@ public boolean validate() { /** * Validate the node for the heap invariants. * - * @param node - * to validate for. + * @param index + * of node to validate for. * @return True if node is valid. */ private boolean validateNode(int index) { From 616213e71c4b8416764a6f32cda9396c85c2f5b0 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 20 Nov 2017 16:17:53 +0900 Subject: [PATCH 4/8] Test unused Method --- .../data_structures/CompactSuffixTrie.java | 5 +++++ .../test/CompactSuffixTrieTests.java | 22 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java b/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java index bc64b598..b2796543 100644 --- a/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java +++ b/src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java @@ -141,4 +141,9 @@ private Set getSuffixes(PatriciaTrie.Node node, String prefix) { public String toString() { return PatriciaTrie.PatriciaTriePrinter.getString(tree); } + + public boolean equals(CompactSuffixTrie trie){ + if(this.getSuffixes().equals(trie.getSuffixes())) return true; + return false; + } } diff --git a/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java b/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java index 8b6bce27..f32f3f64 100644 --- a/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java +++ b/test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java @@ -25,4 +25,26 @@ public void testCompactSuffixTrie() { exists = trie.doesSubStringExist(pass); assertTrue("YIKES!! " + pass + " doesn't exists.", exists); } + + @Test + public void testCompactSuffixTrie_equals() { + String bookkeeper = "bookkeeper"; + CompactSuffixTrie trie = new CompactSuffixTrie(bookkeeper); + + String bookkeeper_1 = "bookkeeper"; + CompactSuffixTrie trie_1 = new CompactSuffixTrie(bookkeeper_1); + + boolean equal = trie.equals(trie_1); + assertTrue("YIKES!! " + bookkeeper + " and " + bookkeeper_1 + " are not equal.", equal); + + + String failed = "failed"; + trie = new CompactSuffixTrie(failed); + + String failed_1 = "failet"; + trie_1 = new CompactSuffixTrie(failed_1); + + equal = trie.equals(trie_1); + assertFalse("YIKES!! " + failed + " and " + failed_1 + " are equal.", equal); + } } From aac1f8b1a704140283e8ca99f762aa5b1d3c95b4 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:29:45 +0900 Subject: [PATCH 5/8] Fixed Param comment --- src/com/jwetherell/algorithms/data_structures/HashMap.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/HashMap.java b/src/com/jwetherell/algorithms/data_structures/HashMap.java index 76c669de..6556d4b9 100644 --- a/src/com/jwetherell/algorithms/data_structures/HashMap.java +++ b/src/com/jwetherell/algorithms/data_structures/HashMap.java @@ -212,9 +212,6 @@ private void initializeMap(int length) { * * @param h * hash to get index of. - * @param length - * length of array - * * @return Integer which represents the key. */ private int indexOf(int h) { From ac23dab6c7d6663808d28e2fc920d43cbe02da5d Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:34:11 +0900 Subject: [PATCH 6/8] Fixed Param comment in InterverTree --- .../algorithms/data_structures/IntervalTree.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/com/jwetherell/algorithms/data_structures/IntervalTree.java b/src/com/jwetherell/algorithms/data_structures/IntervalTree.java index a04113ba..1a82ef30 100644 --- a/src/com/jwetherell/algorithms/data_structures/IntervalTree.java +++ b/src/com/jwetherell/algorithms/data_structures/IntervalTree.java @@ -314,7 +314,7 @@ public IntervalData(long start, long end, O object) { /** * Interval data list which should all be unique * - * @param list + * @param set * of interval data objects */ public IntervalData(long start, long end, Set set) { @@ -389,10 +389,9 @@ public IntervalData copy() { /** * Query inside this data object. * - * @param start - * of range to query for. - * @param end - * of range to query for. + * @param index + * to find Data. + * * @return Data queried for or NULL if it doesn't match the query. */ public IntervalData query(long index) { From b85ef7e0cb69af9ce2e8673594a6c087ac895929 Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:38:43 +0900 Subject: [PATCH 7/8] Fixed Param comment in SegmentTree --- src/com/jwetherell/algorithms/data_structures/SegmentTree.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/data_structures/SegmentTree.java b/src/com/jwetherell/algorithms/data_structures/SegmentTree.java index 9a04b8e6..fb516d8e 100644 --- a/src/com/jwetherell/algorithms/data_structures/SegmentTree.java +++ b/src/com/jwetherell/algorithms/data_structures/SegmentTree.java @@ -696,7 +696,7 @@ public IntervalData(long start, long end, O object) { /** * Interval data list which should all be unique * - * @param list + * @param set * of interval data objects */ public IntervalData(long start, long end, Set set) { From 5033342d1c679beb35ece62592b80cb4c66df59a Mon Sep 17 00:00:00 2001 From: ParkChangHan Date: Mon, 27 Nov 2017 16:45:53 +0900 Subject: [PATCH 8/8] Fixed Param comment in ConnectedComponents --- src/com/jwetherell/algorithms/graph/ConnectedComponents.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/jwetherell/algorithms/graph/ConnectedComponents.java b/src/com/jwetherell/algorithms/graph/ConnectedComponents.java index dae44174..e096950c 100644 --- a/src/com/jwetherell/algorithms/graph/ConnectedComponents.java +++ b/src/com/jwetherell/algorithms/graph/ConnectedComponents.java @@ -25,7 +25,8 @@ private ConnectedComponents() { } /** * Finds the connected components subsets of the Graph. * - * @param g Graph to find connected components. + * @param graph + * to find connected components. * @return List of connected components in the Graph. */ public static final > List>> getConnectedComponents(Graph graph) {