Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
p2
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Han Zhang
p2
Commits
b9783818
Commit
b9783818
authored
9 years ago
by
Adam Blank
Browse files
Options
Downloads
Plain Diff
Merge branch 'tweak-binary-search-tree' into 'master'
Fix docs + tweak misleading comment in BST See merge request !3
parents
26a9d8df
e750d4fb
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cse332/datastructures/trees/BinarySearchTree.java
+5
-3
5 additions, 3 deletions
src/cse332/datastructures/trees/BinarySearchTree.java
with
5 additions
and
3 deletions
src/cse332/datastructures/trees/BinarySearchTree.java
+
5
−
3
View file @
b9783818
...
...
@@ -35,9 +35,11 @@ public class BinarySearchTree<K extends Comparable<K>, V>
public
BSTNode
[]
children
;
// The children of this node.
/**
* Create a new data node
and increment the enclosing tree's size
.
* Create a new data node.
*
* @param data
* @param key
* key with which the specified value is to be associated
* @param value
* data element to be stored at this node.
*/
@SuppressWarnings
(
"unchecked"
)
...
...
@@ -68,7 +70,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
)
{
current
=
new
BSTNode
(
key
,
null
);
if
(
this
.
root
==
null
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment