We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b23d809 commit 1af8f70Copy full SHA for 1af8f70
Linked List/linked_list_reverse.js
@@ -23,6 +23,8 @@ var reverseList = function(head) {
23
// Returning the head of the reversed linked list
24
return prev;
25
};
26
+// Time complexity - O(N)
27
+// Space complexity - O(1)
28
29
// Recursively
30
var reverseList = function(head) {
@@ -41,3 +43,5 @@ var reverseList = function(head) {
41
43
42
44
return reversedList;
45
46
47
+// Space complexity - O(N)
0 commit comments