<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Coding Kata &#8211; February 1st 2010 &#8211; Flippin&#8217; Lists</title>
	<atom:link href="http://www.chriscowdery.com/posts/151/feed" rel="self" type="application/rss+xml" />
	<link>http://www.chriscowdery.com/posts/151</link>
	<description>Coding, Design and all things Tech</description>
	<lastBuildDate>Sun, 13 Jun 2010 00:08:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Eli Fox-Epstein</title>
		<link>http://www.chriscowdery.com/posts/151/comment-page-1#comment-96</link>
		<dc:creator>Eli Fox-Epstein</dc:creator>
		<pubDate>Sun, 13 Jun 2010 00:08:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscowdery.com/?p=151#comment-96</guid>
		<description>For those that want some elegance (and are okay with value-rewriting instead of link-rewriting which AFAIK is fine in most functional languages), try this one out: https://gist.github.com/1b84be2b4c91d95b52c1

P.S. Kevin, your solution fails where the linked list has length less than three.
P.P.S. Chris, hope things are going well. Interesting problem. The spec should probably say &quot;flip 2-tuples&quot; or &quot;flip pairs&quot;, though, as a &quot;tuple&quot; is just any ordered list.</description>
		<content:encoded><![CDATA[<p>For those that want some elegance (and are okay with value-rewriting instead of link-rewriting which AFAIK is fine in most functional languages), try this one out: <a href="https://gist.github.com/1b84be2b4c91d95b52c1" rel="nofollow">https://gist.github.com/1b84be2b4c91d95b52c1</a></p>
<p>P.S. Kevin, your solution fails where the linked list has length less than three.<br />
P.P.S. Chris, hope things are going well. Interesting problem. The spec should probably say &#8220;flip 2-tuples&#8221; or &#8220;flip pairs&#8221;, though, as a &#8220;tuple&#8221; is just any ordered list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.chriscowdery.com/posts/151/comment-page-1#comment-36</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Wed, 03 Feb 2010 01:08:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscowdery.com/?p=151#comment-36</guid>
		<description>Sweet, there it is! :)</description>
		<content:encoded><![CDATA[<p>Sweet, there it is! <img src='http://www.chriscowdery.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin Kuchta</title>
		<link>http://www.chriscowdery.com/posts/151/comment-page-1#comment-35</link>
		<dc:creator>Kevin Kuchta</dc:creator>
		<pubDate>Tue, 02 Feb 2010 01:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.chriscowdery.com/?p=151#comment-35</guid>
		<description>Killin&#039; time before an interview.  This seems like a productive way to do that.


while( notDone ){
	zeroth = node.prev
	first = node
	second = node.next
	third = second.next
	
	if(zeroth != null){
		zeroth.next=second
	}
	second.next=first
	second.prev = zeroth
	first.next=third
	first.prev=second
	
	if(third != null){
		third.prev = first
	}
	
	//If no more after this pair, or only one more, end
	if( third == null &#124;&#124; third.next == null ){
		notDone = false
	}
	else{
		//skip up to the next pair
		node = node.next.next
	}
}</description>
		<content:encoded><![CDATA[<p>Killin&#8217; time before an interview.  This seems like a productive way to do that.</p>
<p>while( notDone ){<br />
	zeroth = node.prev<br />
	first = node<br />
	second = node.next<br />
	third = second.next</p>
<p>	if(zeroth != null){<br />
		zeroth.next=second<br />
	}<br />
	second.next=first<br />
	second.prev = zeroth<br />
	first.next=third<br />
	first.prev=second</p>
<p>	if(third != null){<br />
		third.prev = first<br />
	}</p>
<p>	//If no more after this pair, or only one more, end<br />
	if( third == null || third.next == null ){<br />
		notDone = false<br />
	}<br />
	else{<br />
		//skip up to the next pair<br />
		node = node.next.next<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
</channel>
</rss>
