Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 762fb2f

Browse files
Merge pull request #78 from ParkChangHan/master
Fixed Param of Comment & Test unused Method
2 parents 313d51f + 5033342 commit 762fb2f

File tree

8 files changed

+39
-15
lines changed

8 files changed

+39
-15
lines changed

‎src/com/jwetherell/algorithms/data_structures/BTree.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public boolean add(T value) {
109109
/**
110110
* The node's key size is greater than maxKeySize, split down the middle.
111111
*
112-
* @param node
112+
* @param nodeToSplit
113113
* to split.
114114
*/
115115
private void split(Node<T> nodeToSplit) {

‎src/com/jwetherell/algorithms/data_structures/BinaryHeap.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ public boolean validate() {
289289
/**
290290
* Validate the node for the heap invariants.
291291
*
292-
* @param node
293-
* to validate for.
292+
* @param index
293+
* of node to validate for.
294294
* @return True if node is valid.
295295
*/
296296
private boolean validateNode(int index) {
@@ -449,8 +449,8 @@ public int size() {
449449
/**
450450
* Get the navigation directions through the tree to the index.
451451
*
452-
* @param index
453-
* of the Node to get directions for.
452+
* @param idx
453+
* index of the Node to get directions for.
454454
* @return Integer array representing the directions to the index.
455455
*/
456456
private static int[] getDirections(int idx) {

‎src/com/jwetherell/algorithms/data_structures/CompactSuffixTrie.java‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,9 @@ private Set<String> getSuffixes(PatriciaTrie.Node node, String prefix) {
141141
public String toString() {
142142
return PatriciaTrie.PatriciaTriePrinter.getString(tree);
143143
}
144+
145+
public boolean equals(CompactSuffixTrie<C> trie){
146+
if(this.getSuffixes().equals(trie.getSuffixes())) return true;
147+
return false;
148+
}
144149
}

‎src/com/jwetherell/algorithms/data_structures/HashMap.java‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,6 @@ private void initializeMap(int length) {
212212
*
213213
* @param h
214214
* hash to get index of.
215-
* @param length
216-
* length of array
217-
*
218215
* @return Integer which represents the key.
219216
*/
220217
private int indexOf(int h) {

‎src/com/jwetherell/algorithms/data_structures/IntervalTree.java‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public IntervalData(long start, long end, O object) {
314314
/**
315315
* Interval data list which should all be unique
316316
*
317-
* @param list
317+
* @param set
318318
* of interval data objects
319319
*/
320320
public IntervalData(long start, long end, Set<O> set) {
@@ -389,10 +389,9 @@ public IntervalData<O> copy() {
389389
/**
390390
* Query inside this data object.
391391
*
392-
* @param start
393-
* of range to query for.
394-
* @param end
395-
* of range to query for.
392+
* @param index
393+
* to find Data.
394+
*
396395
* @return Data queried for or NULL if it doesn't match the query.
397396
*/
398397
public IntervalData<O> query(long index) {

‎src/com/jwetherell/algorithms/data_structures/SegmentTree.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ public IntervalData(long start, long end, O object) {
696696
/**
697697
* Interval data list which should all be unique
698698
*
699-
* @param list
699+
* @param set
700700
* of interval data objects
701701
*/
702702
public IntervalData(long start, long end, Set<O> set) {

‎src/com/jwetherell/algorithms/graph/ConnectedComponents.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private ConnectedComponents() { }
2525
/**
2626
* Finds the connected components subsets of the Graph.
2727
*
28-
* @param g Graph to find connected components.
28+
* @param graph
29+
* to find connected components.
2930
* @return List of connected components in the Graph.
3031
*/
3132
public static final <T extends Comparable<T>> List<List<Vertex<T>>> getConnectedComponents(Graph<T> graph) {

‎test/com/jwetherell/algorithms/data_structures/test/CompactSuffixTrieTests.java‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,26 @@ public void testCompactSuffixTrie() {
2525
exists = trie.doesSubStringExist(pass);
2626
assertTrue("YIKES!! " + pass + " doesn't exists.", exists);
2727
}
28+
29+
@Test
30+
public void testCompactSuffixTrie_equals() {
31+
String bookkeeper = "bookkeeper";
32+
CompactSuffixTrie<String> trie = new CompactSuffixTrie<String>(bookkeeper);
33+
34+
String bookkeeper_1 = "bookkeeper";
35+
CompactSuffixTrie<String> trie_1 = new CompactSuffixTrie<String>(bookkeeper_1);
36+
37+
boolean equal = trie.equals(trie_1);
38+
assertTrue("YIKES!! " + bookkeeper + " and " + bookkeeper_1 + " are not equal.", equal);
39+
40+
41+
String failed = "failed";
42+
trie = new CompactSuffixTrie<String>(failed);
43+
44+
String failed_1 = "failet";
45+
trie_1 = new CompactSuffixTrie<String>(failed_1);
46+
47+
equal = trie.equals(trie_1);
48+
assertFalse("YIKES!! " + failed + " and " + failed_1 + " are equal.", equal);
49+
}
2850
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /