Linked-List

Add Two Numbers

Add two numbers represented as linked lists where digits are stored in reverse order

Circular Linked List Detection

Detect if a linked list has a cycle and find the starting point of the cycle

Copy List with Random Pointer

Create a deep copy of a linked list where each node has a random pointer

Delete Node in a Linked List

Delete a node from a linked list when you only have access to that node

Detect Cycle in Linked List

Detect if a linked list has a cycle using Floyd's cycle detection algorithm

Find Middle of Linked List

Find the middle node of a linked list using the two-pointer technique

Flatten Binary Tree to Linked List

Flatten a binary tree into a linked list in-place using preorder traversal.

Flatten Multilevel Linked List

Flatten a multilevel doubly linked list into a single level

Implement Queue

Implement a queue using arrays or linked lists with O(1) time complexity for all operations.

Implement Stack

Design and implement a stack data structure with push, pop, top, and empty operations

Intersection of Two Linked Lists

Find the intersection node of two linked lists

Merge k Sorted Linked Lists

Merge k sorted linked lists into one sorted linked list

Merge Two Sorted Lists

Merge two sorted linked lists into one sorted linked list

Palindrome Linked List

Check if a linked list is a palindrome using O(1) extra space

Partition List

Partition a linked list around a value x such that all nodes less than x come before nodes greater than or equal to x

Remove Duplicates from Sorted List

Remove all duplicate values from a sorted linked list

Remove Nth Node From End of List

Remove the nth node from the end of a linked list in one pass

Reorder List

Reorder a linked list by interleaving nodes from the beginning and end

Reverse a Linked List

Reverse a singly linked list in-place

Reverse Nodes in k-Group

Reverse every k consecutive nodes in a linked list

Rotate Linked List

Rotate a linked list to the right by k places

Sort Linked List

Sort a linked list in O(n log n) time using constant extra space

Swap Nodes in Pairs

Swap every two adjacent nodes in a linked list