Skip to content

Fixed Param of Comment & Test unused Method #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Feb 14, 2018
Merged
2 changes: 1 addition & 1 deletion src/com/jwetherell/algorithms/data_structures/BTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> nodeToSplit) {
Expand Down
8 changes: 4 additions & 4 deletions src/com/jwetherell/algorithms/data_structures/BinaryHeap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,4 +141,9 @@ private Set<String> getSuffixes(PatriciaTrie.Node node, String prefix) {
public String toString() {
return PatriciaTrie.PatriciaTriePrinter.getString(tree);
}

public boolean equals(CompactSuffixTrie<C> trie){
if(this.getSuffixes().equals(trie.getSuffixes())) return true;
return false;
}
}
3 changes: 0 additions & 3 deletions src/com/jwetherell/algorithms/data_structures/HashMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<O> set) {
Expand Down Expand Up @@ -389,10 +389,9 @@ public IntervalData<O> 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<O> query(long index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<O> set) {
Expand Down
3 changes: 2 additions & 1 deletion src/com/jwetherell/algorithms/graph/ConnectedComponents.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <T extends Comparable<T>> List<List<Vertex<T>>> getConnectedComponents(Graph<T> graph) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> trie = new CompactSuffixTrie<String>(bookkeeper);

String bookkeeper_1 = "bookkeeper";
CompactSuffixTrie<String> trie_1 = new CompactSuffixTrie<String>(bookkeeper_1);

boolean equal = trie.equals(trie_1);
assertTrue("YIKES!! " + bookkeeper + " and " + bookkeeper_1 + " are not equal.", equal);


String failed = "failed";
trie = new CompactSuffixTrie<String>(failed);

String failed_1 = "failet";
trie_1 = new CompactSuffixTrie<String>(failed_1);

equal = trie.equals(trie_1);
assertFalse("YIKES!! " + failed + " and " + failed_1 + " are equal.", equal);
}
}