Skip to content

Commit 8df62a4

Browse files
committed
Added complexity calculation
1 parent e704e3e commit 8df62a4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

linked-list-cycle/nhistory.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ var hasCycle = function (head) {
2222
}
2323
return false;
2424
};
25+
26+
// TC: O(n)
27+
// SC: O(1)

0 commit comments

Comments
 (0)