<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Two Pointers on Rik Kisnah - Blog</title><link>https://www.rik-kisnah.ai/tags/two-pointers/</link><description>Recent content in Two Pointers on Rik Kisnah - Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 28 Nov 2017 09:00:00 -0800</lastBuildDate><atom:link href="https://www.rik-kisnah.ai/tags/two-pointers/feed.xml" rel="self" type="application/rss+xml"/><item><title>Detect a Cycle in a Linked List</title><link>https://www.rik-kisnah.ai/teach/coding/linked-list-cycle/</link><pubDate>Tue, 28 Nov 2017 09:00:00 -0800</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/linked-list-cycle/</guid><description>Two runners on a track. If the track is a loop, the fast one laps the slow one. If it is a straight road, the fast one falls off the end. No memory needed.</description></item><item><title>Container With Most Water</title><link>https://www.rik-kisnah.ai/teach/coding/container-with-most-water/</link><pubDate>Tue, 08 Nov 2016 09:00:00 -0800</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/container-with-most-water/</guid><description>Vertical walls of different heights. Pick two that hold the most water between them. Start with a finger at each end and always move the shorter wall inward. Same shape as sorted Two Sum, and the lesson is why the move is safe.</description></item><item><title>Move Zeroes</title><link>https://www.rik-kisnah.ai/teach/coding/move-zeroes/</link><pubDate>Tue, 19 Jul 2016 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/move-zeroes/</guid><description>Push every zero to the end of the array without changing the order of everything else. One finger marks where the next non-zero belongs. That finger is the whole idea behind two pointers.</description></item><item><title>Two Sum</title><link>https://www.rik-kisnah.ai/teach/coding/two-sum/</link><pubDate>Tue, 14 Jun 2016 09:00:00 -0700</pubDate><guid>https://www.rik-kisnah.ai/teach/coding/two-sum/</guid><description>Find two numbers in a list that add up to a target. Unsorted list: remember what you have seen in a hash map. Sorted list: one finger at each end, walk them towards each other. Two tricks, one problem, and half of the array questions you will ever be asked.</description></item></channel></rss>