File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,7 @@ Indexer for Data Structures Lover
177
177
178
178
* APPROACH 6: Using recursion
179
179
* [ JAVA] ( Java/Data-Structures/LISTS/MISC/Nth-node-from-end/Approach6.java )
180
- * complexity
180
+ * [ complexity] ( docs/complexity.md#find-the-nth-node-from-end-in-single-linked-list )
181
181
182
182
## :octocat: STACKS
183
183
Original file line number Diff line number Diff line change @@ -85,7 +85,8 @@ This page contains the complexities of different algorithms in this repository.
85
85
* LINKED LIST
86
86
* [ ARRAYLISTS] ( #arraylists-(JAVA) )
87
87
* [ VECTORS] ( #vectors-(C++JAVA) )
88
- * MISC
88
+ * [ MISC LISTS] ( #misc-lists )
89
+ * [ Find the nth node from end in single linked list] ( #find-the-nth-node-from-end-in-single-linked-list )
89
90
* [ STACKS] ( #stacks )
90
91
* [ FIXED ARRAY STACK] ( #fixed-array-stack )
91
92
* [ DYNAMIC ARRAY STACK] ( #dynamic-array-stack )
@@ -432,6 +433,19 @@ SNo. | Operations | Order and Type of Time Complexity O(n) | Order and Type of S
432
433
SNo. | Operations | Order and Type of Time Complexity O(n) | Order and Type of Space Complexity
433
434
---- | ---------- | -------------------------------------- | ----------------------------------
434
435
436
+ #### MISC LISTS
437
+
438
+ ##### Find the nth node from end in single linked list
439
+
440
+ SNo. | APPROACH | Order and Type of Time Complexity O(n) | Order and Type of Space Complexity
441
+ ---- | ---------- | -------------------------------------- | ----------------------------------
442
+ 1 | Compute the size while adding | O(n) -- Linear | O(1) -- Constant
443
+ 2 | Using two current pointers | O(n^2) -- Quadratic | O(1) -- Constant
444
+ 3 | Using hashtable | O(n) -- Linear | O(n) -- Linear
445
+ 4 | Using Hashtable while adding | O(1) -- Constant | O(n) -- Linear
446
+ 5 | Finding node in one scan | O(n) -- Linear | O(1) -- Constant
447
+ 6 | Using recursion | O(n) -- Linear | O(n) -- Linear
448
+
435
449
### STACKS
436
450
437
451
#### FIXED ARRAY STACK
You can’t perform that action at this time.
0 commit comments