<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>De Marino on Zio Ivan</title>
    <link>https://ivandemarino.me/tags/de-marino/</link>
    <description>Recent content in De Marino on Zio Ivan</description>
    <generator>Hugo</generator>
    <language>en</language>
    <managingEditor>detronizator&#43;blog@gmail.com (Ivan De Marino, aka &#34;Zio Ivan&#34;, aka &#34;detro&#34;)</managingEditor>
    <webMaster>detronizator&#43;blog@gmail.com (Ivan De Marino, aka &#34;Zio Ivan&#34;, aka &#34;detro&#34;)</webMaster>
    <copyright>2004-2026 Ivan De Marino. Licensed under CC BY 4.0</copyright>
    <lastBuildDate>Mon, 06 Aug 2012 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://ivandemarino.me/tags/de-marino/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>BST traversal without stack or recursion (?)</title>
      <link>https://ivandemarino.me/posts/bst-traversal-without-stack-or-recursion/</link>
      <pubDate>Mon, 06 Aug 2012 00:00:00 +0000</pubDate><author>detronizator&#43;blog@gmail.com (Ivan De Marino, aka &#34;Zio Ivan&#34;, aka &#34;detro&#34;)</author>
      <guid>https://ivandemarino.me/posts/bst-traversal-without-stack-or-recursion/</guid>
      <description>&lt;p&gt;&lt;strong&gt;SPOILER&lt;/strong&gt;: &lt;em&gt;this article assumes quite a lot of things about your knowledge of binary trees and data structure. I won&amp;rsquo;t spend much time introducing concepts. Deal with it.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Some time ago I had the pleasure to meet with &lt;a href=&#34;http://chrislord.net/blog/&#34;&gt;Chris Lord&lt;/a&gt;, who introduced me to the concept of Binary Tree Traversal without using neither a stack/queue or recursion.&lt;/p&gt;
&lt;p&gt;The list of requirements that such algorithm has to fulfil:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Constant Space: no extra data structure to do the traversal&lt;/li&gt;
&lt;li&gt;Non-destructive: once finished, the tree needs to be exactly how it was before the visit&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sounded &lt;em&gt;crazy&lt;/em&gt; initially, but than I looked into it more deeply and discovered, thanks to some pointers from &lt;a href=&#34;http://twitter.com/lucabox&#34;&gt;Luca Colantonio&lt;/a&gt;, that there is an algorithm &lt;em&gt;in literature&lt;/em&gt; that does just that: &lt;strong&gt;Morris In-Order&lt;/strong&gt; Traversal.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
