Skip to content

Commit

Permalink
Add comments to treeBFSelect.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fay-jai committed Jan 1, 2015
1 parent 91c8510 commit 900194b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions treeBFSelect/treeBFSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ Tree.prototype.BFSelect = function (fn) {
depth += 1;
}

/*
* At this point, inOrder is an array where each element is an array [value, depth]
* (value is the value of the treeNode and depth is the depth of the treeNode)
* and the array is in breadthFirst order
*/
inOrder.forEach(function (array) {
var value = array[0];
var depth = array[1];
Expand Down

0 comments on commit 900194b

Please sign in to comment.