Goals¶
This week we will be covering the fundamentals of linked lists and common ways they appear in interviews.
- Easily build a linked list
- Understand most common variants
- Feel comfortable with recursion
- Two pointer technique
- Dummy head technique
- Comfort with pointer bookkeeping
- Framework for approaching Linked List problems
Monday¶
- Read the Linked List Codepath Wiki Article
- Read about the Dummy Head, Multiple Pass, and Two-Pointer linked list design patterns.
- Solve the following problems (shoot for 30-90 minutes in total)
Wednesday¶
Read the UMPIRE method post here and follow the steps (Understand, Match, Prototype, Implement, Review, and Evaluate) as you solve the problems. Take special care to match based on the linked list designed patterns learned on Monday, and to sketch visualizations / write pseudo code on a notepad near your computer. Pointer Bookeeping (demonstrated in this lecture) can be a helpful tool for linked list diagramming. Also, for a refresher on how pointers work in python read this article on python variables and memory management and/or this passage about simulating pointers in python.
- Odd Even Linked List - LeetCode
- Swap Nodes in Pairs - LeetCode
- Rotate List - LeetCode
- Partition List - LeetCode
- Add Two Numbers II - LeetCode
Saturday¶
- Merge Two Sorted Lists - LeetCode
- Intersection of Two Linked Lists - LeetCode
- Copy List with Random Pointer - LeetCode
- Linked List Cycle II - LeetCode
- Remove Duplicates from Sorted List II - LeetCode
- Reorder List - LeetCode
- Merge k Sorted Lists - LeetCode