Skip to content

Commit

Permalink
Minor modification to linkedListCycles.js
Browse files Browse the repository at this point in the history
  • Loading branch information
fay-jai committed Feb 6, 2015
1 parent e193962 commit 3894583
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions linkedListCycles/linkedListCycles.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ var Node = function (value) {
};
};

var hasCycle = function (linkedList) {
// create two 'runners' who start at the same node
var one = linkedList;
var two = linkedList;
var hasCycle = function (startNode) {
// create two 'runners' who start at the same startNode
var one = startNode;
var two = startNode;

while ( true ) {
// check if the next one or two nodes are null
Expand Down

0 comments on commit 3894583

Please sign in to comment.