update readme
parent
30091ed984
commit
3e789c47d3
@ -0,0 +1,21 @@
|
||||
<h1 align="center">LinkedList Reverse Source</h1>
|
||||
|
||||
[What It Is](#what-it-is)
|
||||
|
||||
## What It Is
|
||||
|
||||
Given pointer to the head node of a linked list, the task is to reverse the linked list. We need to reverse the list by changing links between nodes.
|
||||
|
||||
|
||||
> * Input: Head of following linked list `[1->2->3->4->NULL]`
|
||||
> * Output: Linked list should be changed to `[4->3->2->1->NULL]`
|
||||
|
||||
> * Input: Head of following linked list `[1->2->3->4->5->NULL]`
|
||||
> * Output: Linked list should be changed to `[5->4->3->2->1->NULL]`
|
||||
|
||||
**Algorithm Complexity**
|
||||
|
||||
| Complexity | Notation |
|
||||
| ----------------- |:---------:|
|
||||
| `Time Complexity` | `O(n)` |
|
||||
| `Auxiliary Space` | `O(1)` |
|
Loading…
Reference in New Issue