<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Recursion, Part One: Recursive Data Structures and Functions</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx</link><description>The first thing to wrap your head around is recursively defined data structures. Let's start with something simple. Think about the abstract idea of “list”. Most people think of a “list” as an ordered collection of “items”, one after the other, with a</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Recursion, Part One: Recursive Data Structures and Functions</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#443805</link><pubDate>Wed, 27 Jul 2005 16:20:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:443805</guid><dc:creator>Svend Tofte</dc:creator><description>This all takes me back to the first time I wrote any code at all. I needed a piece of code, that would iterate the DOM tree of NS4. I asked a CS guy nearby on my floor, and he gave me the recursive method. Wonderful stuff.&lt;br&gt;&lt;br&gt;Recursion in and of itself, is not too hard. But when you start writing really hairy recursive stuff, that start folding out, and then folds back into itself, I once heard someone describe recursion as a koan.&lt;br&gt;&lt;br&gt;You just need to look at it, until the dime drops. This of course also explains why programmars count 0, 1, many ;-)</description></item><item><title>re: Recursion, Part One: Recursive Data Structures and Functions</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#443848</link><pubDate>Wed, 27 Jul 2005 18:29:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:443848</guid><dc:creator>estee</dc:creator><description>Oh, Eric, what a good article!&lt;br&gt;&lt;br&gt;By the way, yet another example of tree-like structures and their recursive processing comes to mind. This is (HT|X)ML dynamic generation. Once i saw how Perl deals with this, combining arrays and associative arrays to represent HTML tags/attrs, i often use it's JS equivalent. For instance, a simple HTML template might look like this in JS:&lt;br&gt;&lt;br&gt;['html',{lang:'en-US'}&lt;br&gt; ['head',&lt;br&gt;  ['title']&lt;br&gt;  ['meta',{name:&amp;quot;Generator&amp;quot;,content:&amp;quot;Microsoft Visual Studio .NET 7.1&amp;quot;}],&lt;br&gt;  ['meta',{name:&amp;quot;vs_targetSchema&amp;quot;,content:&amp;quot;&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/intellisense/ie5&amp;quot;"&gt;http://schemas.microsoft.com/intellisense/ie5&amp;quot;&lt;/a&gt;}]&lt;br&gt; ],&lt;br&gt; ['body','&amp;lt;!--insert your HTML here--&amp;gt;']&lt;br&gt;]&lt;br&gt;&lt;br&gt;(Recursive JS code to generate text out of this tree is trivial, of course. Follow the link above to see my impl.)&lt;br&gt;&lt;br&gt;(Sorry, I'm not so smart to generalise this example to something more interesting, like C# trees.. i'm just recursion consumer ;-)</description></item><item><title>re: Recursion, Part One: Recursive Data Structures and Functions</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#444713</link><pubDate>Fri, 29 Jul 2005 04:01:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444713</guid><dc:creator>Muhammad Ali Shah</dc:creator><description>Recursion is beautiful and perhaps, contrary to commonly held belief, it's many times more natural than iterative solutions which do not exploit the recursive nature of data structures or the problem at hand.&lt;br&gt;&lt;br&gt;When they taught it for the first time in school, I thought, &amp;quot;What the heck? I can do this with a loop.&amp;quot; But as we moved onto tree structures and more complex problems like the famous N-Queen problem, I knew that I loved it. Recursion truly stands out.</description></item><item><title>Eric Lippert on Recursion</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#444773</link><pubDate>Fri, 29 Jul 2005 07:41:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:444773</guid><dc:creator>notgartner.com: Mitch Denny's Blog</dc:creator><description /></item><item><title>re: Recursion, Part One: Recursive Data Structures and Functions</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#448122</link><pubDate>Fri, 05 Aug 2005 18:42:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:448122</guid><dc:creator>David Walker</dc:creator><description>&amp;quot;Most people think of a “list” as an ordered collection of “items”,...&amp;quot;&lt;br&gt;&lt;br&gt;I like lists where any item can itself be a list.  And so on.  Nested lists.  &lt;br&gt;&lt;br&gt;APL's &amp;quot;generalized arrays&amp;quot; work that way where any item of an array can be an array.  Way back when, arrays were limited to 63 dimensions though.</description></item><item><title>Recursion</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#453289</link><pubDate>Fri, 19 Aug 2005 01:27:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:453289</guid><dc:creator>Peter Stathakos - Stack Of Toast</dc:creator><description /></item><item><title>re: Recursion, Part One: Recursive Data Structures and Functions</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#700606</link><pubDate>Tue, 15 Aug 2006 06:57:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:700606</guid><dc:creator>Simon</dc:creator><description>It's a nice article. But the property that every parent is in between it's children isnt really significant for binary search trees. the important property is that every node left from the root is less than the root and every node right from it is more than a root..and again every node can itself be a root to a subtree. &lt;br&gt;</description></item><item><title>re: Recursion, Part One: Recursive Data Structures and Functions</title><link>http://blogs.msdn.com/ericlippert/archive/2005/07/27/recursion-part-one-recursive-data-structures-and-functions.aspx#8793292</link><pubDate>Thu, 31 Jul 2008 16:09:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8793292</guid><dc:creator>Pierre</dc:creator><description>&lt;p&gt;Yip Simon you're right about the binary search tree part, the rest is sweet.&lt;/p&gt;
</description></item></channel></rss>