Linked List

Software Developer with over 5 years of experience building high-quality web, mobile, and Android applications. Proficient in JavaScript, TypeScript, Flutter, React, Node.js, and Android development using Kotlin, with a strong background in designing scalable backend services using microservices and event-driven architectures. Experienced in building resilient APIs, asynchronous workflows, and distributed systems that power dynamic user interfaces across platforms. Skilled in solving complex problems, optimizing application performance, and writing clean, maintainable code. Hands-on experience with Docker, Kubernetes, and AWS for containerization, orchestration, and cloud-native deployments. Passionate about turning technical challenges into smart, scalable, and production-ready solutions. As an active competitive programmer, I’ve solved 1,000+ LeetCode problems and rank in the Top 2.22% globally (Knight badge), demonstrating strong expertise in algorithms, data structures, and dynamic programming. I thrive on applying algorithmic thinking to build scalable, real-world systems that create lasting impact.
Reverse a Linked List
Middle of the Linked List
Delete Node in a Linked List
Merge Two Sorted Linked List
Remove duplicates from sorted list
Intersection of two linked list
Linked List Cycle
Palindrome Linked List
Swapping Nodes in a Linked List
Odd Even Linked List
Remove nth node from Linked List
Add Two Numbers
Swap Nodes in Pairs
Split Linked List in Parts
Insertion sort on Linked List
Merge sort on Linked List
Copy list with random pointers
Remove zero sum from consecutive nodes from linked list
Merge k sorted Linked List
Reverse nodes in k group
Doubly Linked List
Adding a node at the front, at the end, after a node or before a node
Deleting a node from the front, from the end, after a node or before a node
Circular Doubly Linked List
Adding a node at the front, at the end, after a node or before a node
Deleting a node from the front, from the end, after a node or before a node
LRU Cache
LFU Cache
206. Reverse Linked List
Explanation :-
We use 3 pointer's prev = previous, curr = current, forw = forward. Where prev will point to the previous pointer, curr will point to the current pointer & forw will point to the next pointer.
Prev will hold the previous value because, if we break the link. So, we will not lose our linked list
Similarly, forward will point to the next pointer after the current. So, once that link is broken, we will not lose our remaining linked list.
Once current reaches null, our prev will be on our new head. So, we will return our prev as the answer.

Solution :-
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(nullptr) {}
};
ListNode* reverseList(ListNode* head) {
ListNode* prev = nullptr;
ListNode* current = head;
while (current != nullptr) {
ListNode* forward = current->next;
current->next = prev;
prev = current;
current = forward;
}
return prev;
}
int main() {
ListNode* head = new ListNode(1);
head->next = new ListNode(2);
head->next->next = new ListNode(3);
head->next->next->next = new ListNode(4);
head->next->next->next->next = new ListNode(5);
}
876. Middle of the Linked List
We will create 2 pointer's fast & slow
Fast pointer will move at the speed of 2X
Slow pointer will move at the speed of 1X
If fast pointer reaches null or fast. next is null, we will return our slow pointer, which mean's our slow pointer is pointing at the middle of linked list
class Solution {
public ListNode middleNode(ListNode head) {
// Base Condition
if(head.next == null) return head;
ListNode slow = head;
ListNode fast = head;
while(fast != null && fast.next != null){
fast = fast.next.next;
slow = slow.next;
}
return slow;
}
}



