LeetCode 876: Middle of the Linked List
A clear explanation of finding the middle node of a singly linked list using slow and fast pointers.
45 notes
A clear explanation of finding the middle node of a singly linked list using slow and fast pointers.
A hash set and linked list traversal solution for counting consecutive components whose values appear in nums.
A clear explanation of splitting a linked list into k consecutive parts with sizes as equal as possible.
A clear explanation of designing a stack that supports push, pop, top, peekMax, and popMax.
A clear explanation of inserting a value into a sorted circular linked list while preserving the circular sorted order.
A clear explanation of implementing a linked list from scratch using nodes, a dummy head, and a size counter.
A clear explanation of designing a hash map without using built-in hash table libraries.
A clear explanation of designing a hash set without using built-in hash table libraries.
A clear explanation of deleting a node from a singly linked list when only that node is given.
A clear explanation of checking whether a singly linked list is a palindrome using fast and slow pointers plus in-place reversal.
A clear explanation of designing an LFU cache with O(1) average get and put operations.
Add two numbers stored in forward-order linked lists using stacks and carry propagation.
Design a data structure that supports increment, decrement, get minimum key, and get maximum key in average O(1) time.
Flatten a multilevel doubly linked list in-place using depth-first traversal and pointer splicing.
Convert a BST into a sorted circular doubly linked list in-place using inorder traversal.
A clear explanation of selecting a random linked list node with equal probability using reservoir sampling.
A clear explanation of adding one to a number stored as a linked list using the rightmost non-nine digit.
A clear explanation of Odd Even Linked List using in-place pointer rewiring.
A clear explanation of reversing a singly linked list using iterative and recursive approaches.
A clear explanation of removing all linked list nodes with a target value using iteration and a dummy node.
A detailed guide to solving Reverse Linked List II with a dummy node and in-place sublist reversal.
A detailed guide to solving Partition List with two dummy lists while preserving relative order.
A detailed guide to solving Remove Duplicates from Sorted List with one pointer and in-place linked list rewiring.
A detailed guide to solving Remove Duplicates from Sorted List II with a dummy node and pointer rewiring.
A clear explanation of finding the node where two singly linked lists intersect using two pointers.
Sort a singly linked list in ascending order using merge sort with fast and slow pointers.
Sort a singly linked list using insertion sort by splicing each node into a growing sorted list.
Design an LRU cache with O(1) get and put operations using a hash map and doubly linked list.
Reorder a singly linked list in-place by finding the middle, reversing the second half, and merging the two halves alternately.
Find the node where a linked list cycle begins using Floyd’s tortoise and hare algorithm with cycle entry mathematics.
Detect whether a linked list contains a cycle using Floyd’s tortoise and hare two-pointer algorithm.
Create a deep copy of a linked list with next and random pointers using hash maps or interleaved node cloning.
A clear explanation of connecting next pointers in any binary tree using constant extra space.
A clear explanation of connecting next pointers in a perfect binary tree using constant extra space.
A clear explanation of flattening a binary tree into a linked list in preorder traversal order using recursive depth-first search.
A clear explanation of converting a sorted linked list into a height-balanced binary search tree using slow and fast pointers.
A clear guide to rotating a linked list to the right by k places using a circular list.
A detailed explanation of reversing linked-list nodes in groups of k using pointer manipulation and constant extra space.
A detailed explanation of swapping every two adjacent nodes in a linked list using pointer manipulation.
A detailed explanation of merging k sorted linked lists using a min heap.
A detailed explanation of merging two sorted linked lists using a dummy node and pointer splicing.
A detailed explanation of removing the nth node from the end of a singly linked list using two pointers and a dummy node.
A detailed explanation of the Add Two Numbers linked list problem, including digit-by-digit addition, carry handling, and linked list construction.
Singly, doubly, and circular linked lists with operations for insertion, reversal, cycle detection, sorting, and memory pooling.
Extract increasing subsequences and merge them to form a sorted sequence.