<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linked-List on</title><link>https://h30306.github.io/blog/tags/linked-list/</link><description>Recent content in Linked-List on</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>hwork0511@gmail.com (Wei Yi Chung)</managingEditor><webMaster>hwork0511@gmail.com (Wei Yi Chung)</webMaster><copyright>© 2026 Wei Yi Chung</copyright><lastBuildDate>Sun, 01 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://h30306.github.io/blog/tags/linked-list/index.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode 25: Reverse Nodes in k-Group</title><link>https://h30306.github.io/blog/leetcode/leetcode-25/</link><pubDate>Sun, 01 Nov 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-25/</guid><description>LeetCode 25 note: count the length to know how many full groups to reverse, k nodes each; a dummy head avoids special-casing the first group, and the old group head becomes its tail</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-25/featured.png"/></item><item><title>LeetCode 328: Odd Even Linked List</title><link>https://h30306.github.io/blog/leetcode/leetcode-328/</link><pubDate>Sun, 01 Nov 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-328/</guid><description>LeetCode 328 note: build one list from odd positions and one from even positions, then append the even list to the odd one; remember to cut the even list&amp;rsquo;s tail</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-328/featured.png"/></item><item><title>LeetCode 146: LRU Cache</title><link>https://h30306.github.io/blog/leetcode/leetcode-146/</link><pubDate>Sat, 31 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-146/</guid><description>LeetCode 146 note: a hash map finds nodes and a doubly linked list keeps the usage order; both get and updating an existing key must move the node to the front</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-146/featured.png"/></item><item><title>LeetCode 460: LFU Cache</title><link>https://h30306.github.io/blog/leetcode/leetcode-460/</link><pubDate>Sat, 31 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-460/</guid><description>LeetCode 460 note: key → node, freq → doubly linked list, plus a min_freq; within the same frequency, LRU decides what to evict</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-460/featured.png"/></item><item><title>Linked List</title><link>https://h30306.github.io/blog/algorithm/linked-list/</link><pubDate>Wed, 21 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/algorithm/linked-list/</guid><description>Dummy heads, reversal (whole list, a range, half), fast and slow pointers for middles and cycles, two pointers n apart, pairwise swaps, two lists meeting, and copying a list with random pointers via a hash map</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/algorithm/linked-list/featured.png"/></item><item><title>LeetCode 23: Merge k Sorted Lists</title><link>https://h30306.github.io/blog/leetcode/leetcode-23/</link><pubDate>Tue, 20 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-23/</guid><description>LeetCode 23 note: a heap that holds only k heads, and divide-and-conquer pairwise merging</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-23/featured.png"/></item><item><title>LeetCode 21: Merge Two Sorted Lists</title><link>https://h30306.github.io/blog/leetcode/leetcode-21/</link><pubDate>Sun, 18 Oct 2026 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-21/</guid><description>LeetCode 21 note: the dummy node, and why Python assignment is not a copy</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-21/featured.png"/></item><item><title>LeetCode 1290: Convert Binary Number in a Linked List to Integer</title><link>https://h30306.github.io/blog/leetcode/leetcode-1290/</link><pubDate>Mon, 14 Jul 2025 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-1290/</guid><description>LeetCode 1290 note: walk head to tail, shifting the running value left by one and adding the new bit</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-1290/featured.png"/></item><item><title>LeetCode 2487: Remove Nodes From Linked List</title><link>https://h30306.github.io/blog/leetcode/leetcode-2487/</link><pubDate>Mon, 06 May 2024 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-2487/</guid><description>LeetCode 2487 note: the kept nodes are non-increasing left to right; keep a monotonic stack, pop anything smaller than the new node, then link what remains</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-2487/featured.png"/></item><item><title>LeetCode 92: Reverse Linked List II</title><link>https://h30306.github.io/blog/leetcode/leetcode-92/</link><pubDate>Sat, 26 Nov 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-92/</guid><description>LeetCode 92 note: walk a dummy to the node before left, then move the following nodes one at a time to just after it, right - left times</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-92/featured.png"/></item><item><title>LeetCode 109: Convert Sorted List to Binary Search Tree</title><link>https://h30306.github.io/blog/leetcode/leetcode-109/</link><pubDate>Sat, 19 Nov 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-109/</guid><description>LeetCode 109 note: take the middle found with fast and slow pointers as the root and recurse on both halves; the height balances naturally</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-109/featured.png"/></item><item><title>LeetCode 116: Populating Next Right Pointers in Each Node</title><link>https://h30306.github.io/blog/leetcode/leetcode-116/</link><pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-116/</guid><description>LeetCode 116 note: in a perfect binary tree, walk each level through the next pointers already set on the level above: left.next = right and right.next = next.left, with O(1) extra space</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-116/featured.png"/></item><item><title>LeetCode 117: Populating Next Right Pointers in Each Node II</title><link>https://h30306.github.io/blog/leetcode/leetcode-117/</link><pubDate>Fri, 18 Nov 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-117/</guid><description>LeetCode 117 note: connect next pointers level by level with BFS; for a non-perfect tree, looking only at the neighbour&amp;rsquo;s children breaks the chain</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-117/featured.png"/></item><item><title>LeetCode 148: Sort List</title><link>https://h30306.github.io/blog/leetcode/leetcode-148/</link><pubDate>Thu, 17 Nov 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-148/</guid><description>LeetCode 148 note: split in half with fast and slow pointers, sort each half recursively and merge; O(n log n) with no extra array</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-148/featured.png"/></item><item><title>LeetCode 142: Linked List Cycle II</title><link>https://h30306.github.io/blog/leetcode/leetcode-142/</link><pubDate>Mon, 14 Nov 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-142/</guid><description>LeetCode 142 note: after fast and slow meet, send one back to head and step both one at a time; they meet again at the cycle entry</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-142/featured.png"/></item><item><title>LeetCode 138: Copy List with Random Pointer</title><link>https://h30306.github.io/blog/leetcode/leetcode-138/</link><pubDate>Sat, 29 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-138/</guid><description>LeetCode 138 note: the first pass maps old nodes to new ones, the second wires next and random; seed the dictionary with None -&amp;gt; None</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-138/featured.png"/></item><item><title>LeetCode 143: Reorder List</title><link>https://h30306.github.io/blog/leetcode/leetcode-143/</link><pubDate>Sat, 29 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-143/</guid><description>LeetCode 143 note: find the middle, reverse the second half, and merge the two alternately, cutting the first half&amp;rsquo;s tail</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-143/featured.png"/></item><item><title>LeetCode 82: Remove Duplicates from Sorted List II</title><link>https://h30306.github.io/blog/leetcode/leetcode-82/</link><pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-82/</guid><description>LeetCode 82 note: every duplicated value goes, the head included, so use a dummy; on a duplicate skip to the next different value and link prev.next past it</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-82/featured.png"/></item><item><title>LeetCode 86: Partition List</title><link>https://h30306.github.io/blog/leetcode/leetcode-86/</link><pubDate>Wed, 26 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-86/</guid><description>LeetCode 86 note: two dummies collect nodes below x and at least x, then join them, setting the second part&amp;rsquo;s tail to None</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-86/featured.png"/></item><item><title>LeetCode 61: Rotate List</title><link>https://h30306.github.io/blog/leetcode/leetcode-61/</link><pubDate>Sat, 22 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-61/</guid><description>LeetCode 61 note: count the length and close a ring, take k %= n, walk n - k - 1 steps from the head to the new tail, and break there</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-61/featured.png"/></item><item><title>LeetCode 24: Swap Nodes in Pairs</title><link>https://h30306.github.io/blog/leetcode/leetcode-24/</link><pubDate>Fri, 21 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-24/</guid><description>LeetCode 24 note: a dummy plus pairs, rewiring prev.next, a.next and b.next together; swap nodes, not values</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-24/featured.png"/></item><item><title>LeetCode 19: Remove Nth Node From End of List</title><link>https://h30306.github.io/blog/leetcode/leetcode-19/</link><pubDate>Thu, 20 Oct 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-19/</guid><description>LeetCode 19 note: from a dummy, move fast n + 1 steps ahead, then move both to the end; slow stops before the node to delete</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-19/featured.png"/></item><item><title>LeetCode 876: Middle of the Linked List</title><link>https://h30306.github.io/blog/leetcode/leetcode-876/</link><pubDate>Tue, 20 Sep 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-876/</guid><description>LeetCode 876 note: fast moves two steps and slow one; when fast reaches the end slow is in the middle, the right-middle for even lengths</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-876/featured.png"/></item><item><title>LeetCode 705: Design HashSet</title><link>https://h30306.github.io/blog/leetcode/leetcode-705/</link><pubDate>Wed, 31 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-705/</guid><description>LeetCode 705 note: a fixed number of buckets, with the key modulo the bucket count choosing the bucket and a list per bucket handling collisions</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-705/featured.png"/></item><item><title>LeetCode 234: Palindrome Linked List</title><link>https://h30306.github.io/blog/leetcode/leetcode-234/</link><pubDate>Mon, 22 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-234/</guid><description>LeetCode 234 note: find the middle with fast and slow pointers, reverse the second half, and compare from both ends with O(1) extra space</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-234/featured.png"/></item><item><title>LeetCode 237: Delete Node in a Linked List</title><link>https://h30306.github.io/blog/leetcode/leetcode-237/</link><pubDate>Mon, 22 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-237/</guid><description>LeetCode 237 note: without the previous node, copy the next node&amp;rsquo;s value over and delete the next node instead</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-237/featured.png"/></item><item><title>LeetCode 203: Remove Linked List Elements</title><link>https://h30306.github.io/blog/leetcode/leetcode-203/</link><pubDate>Sun, 21 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-203/</guid><description>LeetCode 203 note: the head may be deleted too, so a dummy head turns every deletion into deleting cur.next; do not advance after deleting</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-203/featured.png"/></item><item><title>LeetCode 206: Reverse Linked List</title><link>https://h30306.github.io/blog/leetcode/leetcode-206/</link><pubDate>Sun, 21 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-206/</guid><description>LeetCode 206 note: three pointers prev / cur / nxt; save the next node, then point cur.next back at prev</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-206/featured.png"/></item><item><title>LeetCode 141: Linked List Cycle</title><link>https://h30306.github.io/blog/leetcode/leetcode-141/</link><pubDate>Sat, 20 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-141/</guid><description>LeetCode 141 note: Floyd&amp;rsquo;s cycle detection, fast two steps and slow one; with a cycle they must meet, each advancing from its own position</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-141/featured.png"/></item><item><title>LeetCode 160: Intersection of Two Linked Lists</title><link>https://h30306.github.io/blog/leetcode/leetcode-160/</link><pubDate>Sat, 20 Aug 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-160/</guid><description>LeetCode 160 note: each pointer walks its own list then the other&amp;rsquo;s; both cover lenA + lenB steps and reach the intersection, or None, together</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-160/featured.png"/></item><item><title>LeetCode 83: Remove Duplicates from Sorted List</title><link>https://h30306.github.io/blog/leetcode/leetcode-83/</link><pubDate>Wed, 20 Jul 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-83/</guid><description>LeetCode 83 note: sorted, so duplicates are adjacent; skip cur.next while it equals cur, and advance only otherwise</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-83/featured.png"/></item><item><title>LeetCode 2: Add Two Numbers</title><link>https://h30306.github.io/blog/leetcode/leetcode-2/</link><pubDate>Sat, 19 Feb 2022 00:00:00 +0000</pubDate><author>hwork0511@gmail.com (Wei Yi Chung)</author><guid>https://h30306.github.io/blog/leetcode/leetcode-2/</guid><description>LeetCode 2 note: digits are stored in reverse, so add from the head digit by digit with a carry, looping until both lists end and no carry remains</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://h30306.github.io/blog/leetcode/leetcode-2/featured.png"/></item></channel></rss>