Skip to content
Snippets Groups Projects
Commit d43ac54c authored by Michael Lee's avatar Michael Lee
Browse files

Fix docs + tweak misleading comment in BST

parent 2534033d
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,9 @@ public class BinarySearchTree<K extends Comparable<K>, V> ...@@ -37,7 +37,9 @@ public class BinarySearchTree<K extends Comparable<K>, V>
/** /**
* Create a new data node and increment the enclosing tree's size. * Create a new data node and increment the enclosing tree's size.
* *
* @param data * @param key
* key with which the specified value is to be associated
* @param value
* data element to be stored at this node. * data element to be stored at this node.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
...@@ -71,7 +73,7 @@ public class BinarySearchTree<K extends Comparable<K>, V> ...@@ -71,7 +73,7 @@ public class BinarySearchTree<K extends Comparable<K>, V>
} }
} }
// If value is null, we need to actually add in the new value // If value is not null, we need to actually add in the new value
if (value != null) { if (value != null) {
current = new BSTNode(key, value); current = new BSTNode(key, value);
if (this.root == null) { if (this.root == null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment