<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Think Like A Programmer]]></title><description><![CDATA[Breaking down computer stuff so that even a 3 year old can understand]]></description><link>https://bowtiedhamachi.substack.com</link><image><url>https://substackcdn.com/image/fetch/$s_!YQd2!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbowtiedhamachi.substack.com%2Fimg%2Fsubstack.png</url><title>Think Like A Programmer</title><link>https://bowtiedhamachi.substack.com</link></image><generator>Substack</generator><lastBuildDate>Sat, 04 Jul 2026 03:35:46 GMT</lastBuildDate><atom:link href="https://bowtiedhamachi.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[BowTiedHamachi]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[bowtiedhamachi@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[bowtiedhamachi@substack.com]]></itunes:email><itunes:name><![CDATA[BowTiedHamachi]]></itunes:name></itunes:owner><itunes:author><![CDATA[BowTiedHamachi]]></itunes:author><googleplay:owner><![CDATA[bowtiedhamachi@substack.com]]></googleplay:owner><googleplay:email><![CDATA[bowtiedhamachi@substack.com]]></googleplay:email><googleplay:author><![CDATA[BowTiedHamachi]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Taking a short break]]></title><description><![CDATA[Think Like A Programmer is taking a short pause]]></description><link>https://bowtiedhamachi.substack.com/p/taking-a-short-break</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/taking-a-short-break</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 11 Mar 2023 14:00:21 GMT</pubDate><content:encoded><![CDATA[<p>Dear Reader,</p><p>Thank you for your support for the past few months - we&#8217;ve written almost 20+ articles about programming, covering topics like general programming to python introductory articles and finally what I&#8217;m most proud of our data structure modules. </p><p>Due to some personal matters, I&#8217;ve been unable to churn out content on a regular basis. As a result, I&#8217;ve missed 1 week in our usual cycle.</p><p>I predict that I&#8217;ll need about 1-2 months to resolve everything so that I can get back to generating the content that I think you guys deserve. As such, I&#8217;ve paused subscriptions for the time being for all paid subscribers until these problems are resolved. </p><p>I&#8217;ll be sending out a reminder email 1-2 weeks before I resume subscriptions so no worries about getting any nasty suprise bills.</p><p>Hope that you guys are doing well no matter which part of the world you guys are in.</p><p>Best,</p><p>BowTiedHamachi.</p>]]></content:encoded></item><item><title><![CDATA[Python 3]]></title><description><![CDATA[Going beyond just a "Hello World"]]></description><link>https://bowtiedhamachi.substack.com/p/python-3</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/python-3</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 25 Feb 2023 14:31:00 GMT</pubDate><content:encoded><![CDATA[<p>Welcome Back to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you.</p><p>In today&#8217;s article we&#8217;ll be looking at how to work with variables in python. if you</p><blockquote><p>If you haven&#8217;t looked at the previous two lessons - please do so first. That way you&#8217;ll be able to walk through all the source code that we&#8217;ve provided in this article.<br><br>You can check out the two articles here <br><br>&#128073; <a href="https://bowtiedhamachi.substack.com/p/learning-python-1">Setting Up Your Python Development Environment</a><br><br>&#128073; <a href="https://bowtiedhamachi.substack.com/p/python-2-your-first-program">What is the PVM?</a><br></p></blockquote><p>So, without ado, let&#8217;s start our python programming language journey. At this point I will assume that you already have your python development environment setup and know how to run a program. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>If you&#8217;re still facing problems with your set-up, feel free to reach out and drop me a message at any point in time.</p><h1>Our First Baby Steps</h1><p>Last week, we got python to print out some strings for us using the following file</p><pre><code>content = "hello world"
print(content)</code></pre><p>When we ran this code, we got the output of </p><pre><code>hello world</code></pre><p>Let&#8217;s revisit our original input - output diagram</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ptch!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ptch!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 424w, https://substackcdn.com/image/fetch/$s_!ptch!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 848w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1272w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ptch!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png" width="835" height="248" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:248,&quot;width&quot;:835,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ptch!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 424w, https://substackcdn.com/image/fetch/$s_!ptch!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 848w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1272w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In this case, what is our input and what is our output? Well let&#8217;s walk through the code step by step to see how <strong>hello world</strong> might be printed out.</p><p>In our first line, we declared a variable called <strong>content</strong> and assigned the value of hello world to it. </p><p>This was our first use of what is known as a python variable. </p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/python-3">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Python 2 - The PVM]]></title><description><![CDATA[What happened when we did our first hello world?]]></description><link>https://bowtiedhamachi.substack.com/p/python-2-your-first-program</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/python-2-your-first-program</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 11 Feb 2023 14:31:05 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!1UKN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome Back to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you.</p><p>In today&#8217;s article we&#8217;ll be looking at what happens when you point python towards a file under the hood.</p><blockquote><p>If you haven&#8217;t looked at the previous lesson on setting up your development environment for python - please do so first. That way you&#8217;ll be able to walk through all the source code that we&#8217;ve provided in this article.<br><br>You can check out the article here &#128073;  <a href="https://bowtiedhamachi.substack.com/p/learning-python-1">Setting Up Your Python Development Environment</a> </p></blockquote><p>So, without ado, let&#8217;s start our python programming language journey. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>If you&#8217;re running python locally on your computer, I highly suggest using <a href="https://code.visualstudio.com/">VSCode</a> - a lot of a random guys online will claim that emacs or vim is the superior experience but they are both really difficult to pick up for a beginner.<br><br>I would say that while you are learning to code, reduce the complexity that you need to deal with and focus more on the programming side. If the program compiles, you&#8217;re good. </p><p><em>Functionality first, ergonomics second.</em></p><h1>Programs</h1><p>Last week, we wrote our first python program that printed out <strong>Hello World!</strong> to the screen when we ran it. If you don&#8217;t remember exactly what we did, here&#8217;s a quick recap.</p><p>First we created a new python file - I suggested calling it main.py but you can call it whatever you want</p><p>We then wrote out these few lines of code<br></p><pre><code>content = "hello world"
print(content)</code></pre><p>We then opened our terminal and ran the commands</p><pre><code>~/UnawareSpottedGeeklog$ python3 main.py 
hello world</code></pre><p>This in turn netted us the output</p><pre><code>~/UnawareSpottedGeeklog$ python3 main.py
hello world
~/UnawareSpottedGeeklog$ </code></pre><p>But what&#8217;s happening here under the hood? </p><h1>Mental Model</h1><p>I find it useful to think about all computer programs through a simple input and output model - it&#8217;s the easiest thing to use and it works surprisingly well for a large range of programs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ptch!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ptch!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 424w, https://substackcdn.com/image/fetch/$s_!ptch!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 848w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1272w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ptch!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png" width="835" height="248" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:248,&quot;width&quot;:835,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11282,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ptch!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 424w, https://substackcdn.com/image/fetch/$s_!ptch!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 848w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1272w, https://substackcdn.com/image/fetch/$s_!ptch!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcf22abc-7f49-40d7-89be-0e4e4897c66b_835x248.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Let&#8217;s start from the top</p><ol><li><p>We wrote a program</p></li><li><p>We ran a command called <strong>python3 main.py</strong></p></li><li><p>We got an output</p></li></ol><h2>Compiled Languages vs Interpreted Languages</h2><p>So what happens when we run the command? </p><pre><code>python3 main.py</code></pre><p>For that matter, what even is a compiled language versus an interpreted language and why does it matter?</p><h3>Analogy</h3><p>To make matters a bit more easily, let&#8217;s imagine that you&#8217;ve been thrust into a foreign country where you don&#8217;t speak the language.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1UKN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1UKN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1UKN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1UKN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1UKN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1UKN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg" width="226" height="226" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:612,&quot;width&quot;:612,&quot;resizeWidth&quot;:226,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Man With Question Mark Above His Head Stock Photos, Pictures &amp; Royalty-Free  Images - iStock&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Man With Question Mark Above His Head Stock Photos, Pictures &amp; Royalty-Free  Images - iStock" title="Man With Question Mark Above His Head Stock Photos, Pictures &amp; Royalty-Free  Images - iStock" srcset="https://substackcdn.com/image/fetch/$s_!1UKN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1UKN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1UKN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1UKN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7afa1554-3e8c-48a1-ab9d-d59af87fde91_612x612.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Now, you have two choices if you want someone to help you with something:</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/python-2-your-first-program">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Learning Python 1]]></title><description><![CDATA[Setting up your development environment]]></description><link>https://bowtiedhamachi.substack.com/p/learning-python-1</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/learning-python-1</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 04 Feb 2023 14:30:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!5gJZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome Back to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you.</p><p>In today&#8217;s article we&#8217;ll be looking at </p><ul><li><p>What are some of the advantages and disadvantages of using python as a programming language</p></li><li><p>How to set up your python environment and begin programming in Python. </p></li></ul><p>So, without ado, let&#8217;s begin to start our python programming language journey ~</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h1>Why Python?</h1><p>If you&#8217;re new to programming, you might be wondering to yourself why use python? In other words - among the million programming languages that are out there, why should we bother to use python. </p><p>In my opinion, there are two reasons for this</p><p>(1) It has a lot of libraries written for it</p><p>(2) It&#8217;s easy to interview in</p><p><strong>&#187; It has a lot of libraries</strong></p><p>A programming language is easier to program in when it has a large variety of libraries that have been written for it. This enables you to do more as a programmer because you don&#8217;t need to spend your time worrying about implementing the basic stuff.</p><p>If you want to do machine learning, you&#8217;ve got <a href="https://www.tensorflow.org/">Tensorflow</a> or <a href="https://pytorch.org/">Pytorch</a> which both have been optimised for GPUs. If you want to do web programming in python, you&#8217;ve got <a href="https://www.djangoproject.com/">Django</a> or <a href="https://fastapi.tiangolo.com/">fastAPI</a>. If you want to do web3 programming, well you&#8217;ve got <a href="https://eth-brownie.readthedocs.io/en/stable/">brownie</a> and <a href="https://www.apeworx.io/">Ape</a> right out of the box.</p><p>All it takes for us to take advantage of these fantastic libraries is</p><pre><code>pip install &lt;library name&gt;</code></pre><p>and we are done with the initial setup. </p><p>&#187; <strong>It&#8217;s easy to interview in</strong></p><p>I always use python to interview in. </p><p>This is because the type system is forgiving and the code reads like human pseudocode. Many basic operations such as allocating space, managing array sizes and operations like getting the length of an array are provided with easy functions.</p><p>Compare this to something like C++ ( Not a bad language, just not something I&#8217;d interview in ) where we get error messages like what we see below.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5gJZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5gJZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 424w, https://substackcdn.com/image/fetch/$s_!5gJZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 848w, https://substackcdn.com/image/fetch/$s_!5gJZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 1272w, https://substackcdn.com/image/fetch/$s_!5gJZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5gJZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png" width="566" height="447.5199089874858" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:695,&quot;width&quot;:879,&quot;resizeWidth&quot;:566,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;C++ is a beautiful language : r/ProgrammerHumor&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="C++ is a beautiful language : r/ProgrammerHumor" title="C++ is a beautiful language : r/ProgrammerHumor" srcset="https://substackcdn.com/image/fetch/$s_!5gJZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 424w, https://substackcdn.com/image/fetch/$s_!5gJZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 848w, https://substackcdn.com/image/fetch/$s_!5gJZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 1272w, https://substackcdn.com/image/fetch/$s_!5gJZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa354039a-d89a-4a3b-a5a3-821856bdc910_879x695.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/learning-python-1">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Keeping a Log]]></title><description><![CDATA[Why logs aren't just for programs]]></description><link>https://bowtiedhamachi.substack.com/p/keeping-a-log</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/keeping-a-log</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 28 Jan 2023 14:31:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zIU7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome Back to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you. </p><p>We&#8217;ve been working hard to look at data structures over the last few weeks and so today&#8217;s article will be a welcome break from it for a while. </p><p>In today&#8217;s article - I&#8217;m going to go through my current note taking process as a programmer and how it&#8217;s helped me to save my ass multiple times. I was inspired to write this after reading a <a href="https://bowtiedcrocodile.substack.com/p/how-to-create-an-elite-note-taking">similar article from BowTiedCrocodile</a> at his substack The Bit Shift.</p><blockquote><p>As a disclaimer, I am a junior programmer. I have been programming for a few years but this is just the latest iteration of my current workflow. Open to any feedback or criticism<br><br>If you&#8217;re looking for much more senior advice, consider looking at <a href="https://twitter.com/BowTiedCrocodil">BowTiedCrodile</a>, <a href="https://twitter.com/BowTiedFirefox">BowTiedFirefox</a> and <a href="https://twitter.com/BowTiedFox">BowTiedFox</a></p></blockquote><p>Now that that&#8217;s out of the way, let&#8217;s talk about why you might want to keep some logs. <br><br>Personally for me, there are two main reasons I keep logs and that&#8217;s because they <br>(1) Improve your efficiency as a programmer and <br>(2) Help ensure that you can investigate errors when they come up.</p><p>Personally I divide my own logs into the following types of logs in increasing order of effort</p><ol><li><p>Random scribbles</p></li><li><p>Old Code Snippets</p></li><li><p>Formal Documentation : Actual Articles, Newsletters OR Issue Documentation</p><p></p></li></ol><p>Each serves a different purpose and to me, and as they move up the chain, my understanding of the topic ideally increases. Let&#8217;s look at them one at a time.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Random Scribbles</h2><p>At my day job and when I&#8217;m working on side hustles, I often have a small notepad open to jot things down.</p><p>This might not be the case for everyone BUT i&#8217;ve kept my work notes and my personal side project notes separate on purpose from the start. I do this because</p><ol><li><p>Work Environments are always tracked and you never know just what data is being extracted from the random .txt files lying around the system</p></li><li><p>I&#8217;d rather not risk randomly exposing some confidential data on a public cloud like iCloud or Google Docs. </p></li></ol><p>AGAIN the chances of the two scenarios above are slim and a bit improbable but I think I&#8217;m just a bit more paranoid than most people.</p><p>Let&#8217;s walk you through an example of what this might look like - I took one of my older scribbles and updated some of the stuff in there with nonsense</p><pre><code><strong>....
event : morning standup (date : 12/34/67)</strong>
who is [redacted] and what do they do? What is the purpose of [redacted]

Ok seems like [redacted] has some issues - preliminary issues seem to be that
1. clowns are not showing up
2. Errors occuring at [location redacted]

TODO
1. Get signoff on [redacted] and get confirmation on bouncy castle
2. Coordinate with [redacted] on what's the best color for a clown nose

Created JIRA with issue of [redacted]

FROM &lt;link to JIRA&gt;

<strong>Action</strong> : Attempting to check in [redacted] environmet

Facing this error of

&lt;error copy pasted from terminal&gt;

<strong>Resolution</strong> : Turns out problem was []
...</code></pre><p>In a day I normally take notes as I go along like this, copy and pasting little tidbits and writing a small diary of the things that I&#8217;ve gotten up to. </p><p>I learnt this from my original mentor at the first startup I worked at and It wasn&#8217;t until I started working that this habit came back in full force. </p><p>There&#8217;s a simple reason for this - you can&#8217;t remember everything so offload it into a cheap storage mechanism. </p><p>This is especially true when issues arise from things that you pushed into production 2-4 weeks ago and people need evidence that the problem was with the environment or what not instead of your code. I once pushed code that had an invalid deployment file into production - the code worked but the deployment script didn&#8217;t work as intended in production because I didn&#8217;t know I was supported to modify it.</p><p>Luckily, I had jotted my entire process down in a snippet and was able to locate </p><ul><li><p>The testing environment</p></li><li><p>The logs file which documented my testing</p></li><li><p>The logs file which demonstrated that the desired result was achieved by the code I had deployed</p></li></ul><p>Without this small scribble of notes that I had written almost a month prior, I would have been in so much hot soup. If you aren&#8217;t keeping a small notepad to scribble these things down, I highly recommend you do. </p><p>I personally use OneNote for work stuff ( since microsoft comes shipped with most office computers ) and Bear for my personal stuff since it supports markdown neatly out of the box. The tool really doesn&#8217;t matter to be honest, just choose something and stick with it.</p><p></p><h2>Code Snippets</h2><blockquote><p>Old Code is a love letter from your past self to your future self &lt;3</p></blockquote><p>This brings us to our second form of logs - Code Snippets</p><p>You will often find as a programmer that you&#8217;ll be re-using certain snippets of code no matter what domain you&#8217;re operating in. Ultimately there are some tasks which need to be repeated in different areas of your codebase and different projects.</p><p>What I like to do is to keep all projects I&#8217;ve worked on before on Github - <strong>but set their visibility as private</strong>. What this gives me is a nice UI to help look through some of my old code chunks and quickly filter what relevant sections I need. </p><p>Sometimes, I also include them with the notes that I&#8217;m taking. For instance, here&#8217;s an example which I pulled up from my notes on Airflow that I took sometime back</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zIU7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zIU7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 424w, https://substackcdn.com/image/fetch/$s_!zIU7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 848w, https://substackcdn.com/image/fetch/$s_!zIU7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 1272w, https://substackcdn.com/image/fetch/$s_!zIU7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zIU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png" width="652" height="523" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:523,&quot;width&quot;:652,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:70677,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zIU7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 424w, https://substackcdn.com/image/fetch/$s_!zIU7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 848w, https://substackcdn.com/image/fetch/$s_!zIU7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 1272w, https://substackcdn.com/image/fetch/$s_!zIU7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffcc887d9-6a53-494c-afa9-436d2e17c3a0_652x523.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I&#8217;ve found that this is extremely useful - and you&#8217;ll find that the more projects you code up, the more this comes into play. </p><p>For those of you that want to do this at scale - you can consider looking at some alternatives.</p><ul><li><p>Front-end : Storybook ( Never used it but heard good things about it )</p></li><li><p>Solidity Snippets : <a href="https://www.cookbook.dev/">Cookbook.dev</a> is a fantastic resources for any aspiring smart contract developer</p></li><li><p>General purpose : You can consider using <a href="https://masscode.io/">Masscode</a> which is an open-source plugin with many native integrations into tools such as VSCode. I&#8217;ve never used it but am planning to experiment more with it in 2023.</p><p></p></li></ul><p>Code snippets are a bit more targeted ultimately than just random scribbles because ideally they&#8217;re a bit more targeted than random scribbles - they&#8217;re meant to help you to save time instead of trying to go through an entire rabbit hole to solve a solved problem.</p><h2>Formal Documentation</h2><p>I group two different things under Formal Documentation - Articles and Issues. I consider these two different because the first concerns problems I encounter in personal projects/side hustles while the second concerns work-related context that i need to be able to access quickly. </p><h2>Articles</h2><p>When I encounter a problem multiple times or solved something that I&#8217;ve been working on for some time, I tend to write it up into an article. There are three main reasons for doing so</p><blockquote><p>(1) It&#8217;s an extremely polished version of a code snippet with explanation for me to refer to down the line. </p><p>(2) It helps establish some degree of credibility </p></blockquote><p></p><p>Ultimately you get paid not for your ability to regurgitate the different ways to invert a binary tree but for <strong>the experience that you&#8217;ve gained debugging and testing out your code.</strong> </p><p>A large reason of how I started writing Think Like A Programmer was because I wanted to consolidate my own understanding of data structures. I hadn&#8217;t touched these data structures for a while and I wanted to create a resource that would work best for me. </p><p></p><blockquote><p>You can also find other articles at my website at https://www.bowtiedhamachi.com/articles. I haven&#8217;t been writing for a while due to other commitments but will begin writing more in a few more weeks hopefully once more things clear up!<br><br><strong>Always host your articles on a publicly available domain unless you want to monetise them. </strong></p></blockquote><p></p><p>With <a href="https://vercel.com/">Vercel</a> you can get everything set up for less than 20 USD for 2 years of domain hosting so there&#8217;s not much stopping you. </p><blockquote><p>If there&#8217;s enough demand, I can also release my own website as a template for readers who are looking to kickstart this article process. Just dm me on twitter at @BowTiedHamachi or email me at bowtiedhamachi@proton.me </p></blockquote><p>But these tend to only concern problems that I&#8217;ve encountered on my own side hustles and projects. I cannot for instance, write about problems I&#8217;ve faced at my job while working on proprietary code base and frameworks.</p><p></p><h2>Issue</h2><p>If you&#8217;ve ever worked as a programmer at a larger scale firm, there tends to be a lot more structure in tracking things to be worked on and what you&#8217;ve accomplished. Where I work at, this comes in the form of the AGILE methodology - where every 2-3 weeks we sit down and plan out the tasks we want to accomplish.</p><p>This means that when we work on individual tasks, all of the code we push up is tagged to a specific Jira or issue. </p><blockquote><p><br>You can check out Jira <a href="https://www.atlassian.com/software/jira">here</a> . I personally don&#8217;t recommend the product though, very buggy and slow. Have heard good things about Linear so there&#8217;s also that.<br></p></blockquote><p>As a result, whenever I submit code for review, I always make sure to add a huge comment so that I know what I&#8217;ve done for the task. This tends to take the following format.</p><blockquote><p><strong>Note</strong> : I don&#8217;t do this for my own personal projects as much since this is more to cover my ass in the event that something happens and I need to fix it within 2-3 hours.<br><br>I look to my random scribbles or articles for that.</p></blockquote><pre><code># Testing performed
I logged into [redacted] and performed the following steps
1. Cloned repo from [redacted]
2. I imported in [redacted] configuration and restarted application
3. Triggered [redacted] 
4. Verified [redacted]

# Documentation of Tests
We can see that [redacted] is shown to have been applied via the following logs

[redacted] logs
```
...copy and pasted stuff
```

# Key Pointers
The new changes seem to have been applied when we run pipeline (url : link-to-pipeline) ...</code></pre><p>Often times I will also add in and upload files to the git system that we are using so that I have everything on hand. I&#8217;ve often found that it&#8217;s better to over-document things rather than to under-document them. This way when anything happens you have everything you ned on hand.</p><h2>Documentation</h2><p>I tend to be a bit forgetful when it comes to executing steps - and this initially results in a lot of issues when I started working in production environments. I would always forget 1-2 things that I was supposed to do (Eg. change a variable name or update a specific value when running code locally)</p><p>Thankfully, at my company, we utilise a wiki provider where we can create pages of documentation. So, in my spare time, when I come across a problem more than twice, I try my best to write up a list of all the steps required for me to perform a specific task. I also try to add in as much images as possible of the steps so that the actions required are unambigous.</p><p><strong>This doesn&#8217;t need to be complicated.</strong></p><p>At the end of the day, all it needs to state is just</p><ol><li><p>How to accomplish the task</p></li><li><p>How to verify the task </p></li><li><p>General guidelines/things to take note of</p></li></ol><p>I&#8217;ve found this to be tremendously useful for myself - and for onboarding new hires when they join the team. A lot of time, people aren&#8217;t productive because they don&#8217;t have all the context - so having a wiki to put everything in place is just a useful step to help speed up the process.</p><h1>Summary</h1><p>I hope this was of use to you! I&#8217;ve been experimenting with my note taking system for many years and was a productivity geek who used to do everything from GTD to Kanban. Eventually, I realised that I just need to do two things </p><ol><li><p>Keep the system simple</p></li><li><p>Reduce friction whenever an opportunity arises</p></li></ol><p>If you&#8217;d like to try implementing something like this, I highly recommend starting with something simple - just use apple notes or even notepad++ as long as it is searchable and start noting down the things that you are encountering on a day to day basis.</p><p>Any feedback or suggestions on how I can improve are always welcome.</p><p>  </p><p></p><p></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Heaps Part III]]></title><description><![CDATA[How long does it take to make a heap? Not very long apparently.]]></description><link>https://bowtiedhamachi.substack.com/p/heaps-part-iii</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/heaps-part-iii</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sun, 22 Jan 2023 17:21:03 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!cu46!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc726055c-2bf6-4246-ae49-5e7a178e57cd_882x553.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Introduction</h1><h2>Main Focus</h2><p>Hey all, welcome back to Think Like A Programmer - where we cover programming concepts in bite-sized chunks. </p><p>For those of you that celebrate the Lunar new year, I hope that you guys are having a fantastic time with your loved ones and family. :)</p><p>Moving on to today&#8217;s article, we&#8217;ll finish up our three part series on heaps - which are used to find the maximum or minimum elements of a list of elements in the fastest time. </p><p>This is a continuation of last week&#8217;s article where we looked at</p><ol><li><p>How to represent a heap in memory</p></li><li><p>How to construct a heap from a list of elements from scratch?</p></li></ol><p>So, what&#8217;s left for us to go through with heaps - The short answer is just the time complexity of the max-heapify operations that we mentioned the week before. </p><p>This requires a few concepts to be defined so let&#8217;s go through them one by one.</p><p>The runtime for this is a bit tricky so do try to stick with me as we go through this.</p><h2>Pre-requisites</h2><p>Before starting on the rest of this article, I highly suggest going through our previous articles on</p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/comparing-algorithms">Algorithmic Complexity</a> - to understand what Big O Notation is</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/binary-search-trees">Binary Search Trees</a> - to understand why a heap is not a binary search tree even though it looks like one</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/arrays">Arrays</a> - to understand how index notation works when we use an array to represent our heap</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/heaps-part-i">Heaps Part I</a> - to understand a bit of the context behind today&#8217;s article</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/heaps-ii">Heaps Part II</a> - to understand the exact operations that we&#8217;re working to find the time complexity of</p></li></ol><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Max Heapify Algorithm Swaps</h2><p>Let&#8217;s go through a recap of the max-heapify algorithm one more time. Let&#8217;s assume we have the following binary tree of elements which we started with earlier.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9EgI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9EgI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 424w, https://substackcdn.com/image/fetch/$s_!9EgI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 848w, https://substackcdn.com/image/fetch/$s_!9EgI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 1272w, https://substackcdn.com/image/fetch/$s_!9EgI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9EgI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png" width="429" height="270" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:270,&quot;width&quot;:429,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:21767,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!9EgI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 424w, https://substackcdn.com/image/fetch/$s_!9EgI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 848w, https://substackcdn.com/image/fetch/$s_!9EgI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 1272w, https://substackcdn.com/image/fetch/$s_!9EgI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2fc1d4b8-e77e-4438-b0db-3ad57f000c08_429x270.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This tree has a height which we&#8217;ll call <strong>h</strong>. In this case, it&#8217;s going to be 2. </p><blockquote><p><strong>Definition</strong> : The height of a heap is the number of edges between the longest downward path between a node and a leaf</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ikZI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ikZI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 424w, https://substackcdn.com/image/fetch/$s_!ikZI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 848w, https://substackcdn.com/image/fetch/$s_!ikZI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 1272w, https://substackcdn.com/image/fetch/$s_!ikZI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ikZI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png" width="564" height="268" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:268,&quot;width&quot;:564,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:28942,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!ikZI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 424w, https://substackcdn.com/image/fetch/$s_!ikZI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 848w, https://substackcdn.com/image/fetch/$s_!ikZI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 1272w, https://substackcdn.com/image/fetch/$s_!ikZI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F40b1e145-7491-4d5a-9d3a-fa8d24eca26b_564x268.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>We perform our operation only on non-leaf nodes since leaf nodes are valid heaps by default .</strong> If we encounter a leaf node (Eg. node 2 ), we simply move on to the next node. We can do so by performing two calculations to find the left and right child indexes, and determining if they fall within our heap.</p><p>But what if we encounter a non-leaf node? Well, then the number of swaps required will simply be equal to the level of the node.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s3AG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s3AG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 424w, https://substackcdn.com/image/fetch/$s_!s3AG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 848w, https://substackcdn.com/image/fetch/$s_!s3AG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 1272w, https://substackcdn.com/image/fetch/$s_!s3AG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s3AG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png" width="568" height="267" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:267,&quot;width&quot;:568,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:37962,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!s3AG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 424w, https://substackcdn.com/image/fetch/$s_!s3AG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 848w, https://substackcdn.com/image/fetch/$s_!s3AG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 1272w, https://substackcdn.com/image/fetch/$s_!s3AG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67815fcc-9c82-4279-8d34-9b7f6caecb34_568x267.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We can see here that the nodes highlighted in blue above have a level of 1. If we wanted to balance the heap containing 2,4 and 3, we would need at most one swap.</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/heaps-part-iii">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Heaps II ]]></title><description><![CDATA[how it works under the hood]]></description><link>https://bowtiedhamachi.substack.com/p/heaps-ii</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/heaps-ii</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 14 Jan 2023 15:00:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!xoYZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote><p>Apologies to anyone who might have received a new email today called What to Expect from this newsletter - I was editing some things in my first newsletter Article and accidentally sent it out. </p></blockquote><p></p><p>Welcome Back to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you. </p><p>In today&#8217;s article, we&#8217;ll continue looking at heaps - which are used to find the maximum or minimum elements of a list of elements in the fastest time. This is a continuation of last week&#8217;s article where we looked at </p><ul><li><p>Why use a heap?</p></li><li><p>How to add items to an existing heap</p></li><li><p>How to remove items from an existing heap</p></li></ul><p>Before starting on the rest of this article, I highly suggest going through our previous articles on</p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/comparing-algorithms">Algorithmic Complexity</a> - to understand what Big O Notation is</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/binary-search-trees">Binary Search Trees</a> - to understand why a heap is not a binary search tree even though it looks like one</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/arrays">Arrays</a> - to understand how index notation works when we use an array to represent our heap</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/heaps-part-i">Heaps Part I</a> - to understand a bit of the context behind today&#8217;s article</p></li></ol><p>So, what&#8217;s left for us to go through with heaps?</p><p>The short answer is that we&#8217;re left with 2 big concepts pertaining to heaps</p><ol><li><p>How to represent a heap in memory</p></li><li><p>How to construct a heap from a list of elements from scratch?</p></li></ol><p>We&#8217;ve gone through a few different data structures in the past few weeks, but not all of them will be appropriate for us to reap the benefits of a heap. Let&#8217;s go through them one by one.</p><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Can we use a Linked List? If you&#8217;ve forgotten what these are, you can read our article on linked lists <a href="https://bowtiedhamachi.substack.com/p/linked-lists">here</a>. </p><p>Immediately, a glaring problem jumps out at us - our heap parent nodes have two children each, but our linked list nodes only have space for &#8230;. 1 ? That means that we won&#8217;t be able to use our linked lists at all for heaps. </p><p>The same problem applies when we stretch for <a href="https://bowtiedhamachi.substack.com/p/stacks">Stacks</a> and <a href="https://bowtiedhamachi.substack.com/p/queues">Queues</a> - these all have capacity for at most 1 child or none.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1a1H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1a1H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 424w, https://substackcdn.com/image/fetch/$s_!1a1H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 848w, https://substackcdn.com/image/fetch/$s_!1a1H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 1272w, https://substackcdn.com/image/fetch/$s_!1a1H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1a1H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png" width="374" height="234" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:234,&quot;width&quot;:374,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Linked List&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Linked List" title="Linked List" srcset="https://substackcdn.com/image/fetch/$s_!1a1H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 424w, https://substackcdn.com/image/fetch/$s_!1a1H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 848w, https://substackcdn.com/image/fetch/$s_!1a1H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 1272w, https://substackcdn.com/image/fetch/$s_!1a1H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1db1c0fe-d6a5-4d61-af0c-01adf14e0d91_374x234.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Well, how about using a binary search tree then? That way, each node can have 2 children. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IEbG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IEbG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 424w, https://substackcdn.com/image/fetch/$s_!IEbG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 848w, https://substackcdn.com/image/fetch/$s_!IEbG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 1272w, https://substackcdn.com/image/fetch/$s_!IEbG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IEbG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png" width="478" height="290" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/eeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:290,&quot;width&quot;:478,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IEbG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 424w, https://substackcdn.com/image/fetch/$s_!IEbG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 848w, https://substackcdn.com/image/fetch/$s_!IEbG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 1272w, https://substackcdn.com/image/fetch/$s_!IEbG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Feeae1098-63d6-42cf-99d0-1461c36b47bc_478x290.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>While that does indeed solve our original problem of having enough space to store a reference to 2 children, we have a new problem - finding any element takes at worst O(n) time since we never have a guarantee that our binary search tree is balanced.</p><blockquote><p><br>If you&#8217;re not sure why the worst case scenario is O(n) , revisit our article on Binary Search Trees <a href="https://bowtiedhamachi.substack.com/p/binary-search-trees">here</a>. If you&#8217;re not sure what O(n) is, then revisit our article on Algorithmic Complexity here.<br></p></blockquote><p>This means that even before we can perform our insertion or deletion algorithm, we already incur a cost of O(n) steps at worst.</p><p>So, what&#8217;s the solution here? Surprisingly, it&#8217;s an array - or an dynamic array if you want a heap to be unbounded in size. </p><p>Let&#8217;s build some intuition for why this might be the case.</p><h1>Heaps</h1><h2>Indexing Heaps</h2><p>If you&#8217;ve forgotten what a heap looks like, here you go. </p><blockquote><p>Quick Recap : Is this a max heap or a min heap? Don&#8217;t scroll down until you&#8217;ve made a guess as to what it might be</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xoYZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xoYZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 424w, https://substackcdn.com/image/fetch/$s_!xoYZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 848w, https://substackcdn.com/image/fetch/$s_!xoYZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 1272w, https://substackcdn.com/image/fetch/$s_!xoYZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xoYZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png" width="492" height="413" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:413,&quot;width&quot;:492,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xoYZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 424w, https://substackcdn.com/image/fetch/$s_!xoYZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 848w, https://substackcdn.com/image/fetch/$s_!xoYZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 1272w, https://substackcdn.com/image/fetch/$s_!xoYZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b65acd4-5408-44ff-81bb-f5fb81b8cf04_492x413.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The answer is that, it&#8217;s a min heap! This is because of two reasons</p><ol><li><p><strong>Order : </strong>All parent nodes are smaller than or equal to their child nodes</p></li><li><p><strong>Shape : </strong>All levels, except for the last level, are completely filled. </p></li></ol><p>As a result, we have a min heap. If we were to index the elements from 0, starting from the root node, we would get the following indexes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!KXnW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KXnW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 424w, https://substackcdn.com/image/fetch/$s_!KXnW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 848w, https://substackcdn.com/image/fetch/$s_!KXnW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 1272w, https://substackcdn.com/image/fetch/$s_!KXnW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KXnW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png" width="441" height="367" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:367,&quot;width&quot;:441,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:25106,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!KXnW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 424w, https://substackcdn.com/image/fetch/$s_!KXnW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 848w, https://substackcdn.com/image/fetch/$s_!KXnW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 1272w, https://substackcdn.com/image/fetch/$s_!KXnW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62592722-0e49-4536-bf00-90c2fbf6badc_441x367.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Interestingly, if we have the index of a parent node, we can calculate the indexes of its left and right child using the formula seen below. Note that <strong>i</strong> is the index of the parent node.</p><pre><code>left = 2*i + 1
right = 2*i + 2</code></pre><p>We can verify this is the case by trying a few examples</p><pre><code>Parent = 0
left = 2 * 0 + 1 = 1
right = 2 * 1 + 2 = 2

parent = 1
left = 2 * 1 + 1 = 3
right = 2 * 1 + 2 = 4</code></pre>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/heaps-ii">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Heaps Part I]]></title><description><![CDATA[Heaping on the good stuff in parts]]></description><link>https://bowtiedhamachi.substack.com/p/heaps-part-i</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/heaps-part-i</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 07 Jan 2023 14:30:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/h_600,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffdd9e3d4-2e9f-418b-92d2-c7fb791c76a0_492x413.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome Back to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you. In today&#8217;s article, we&#8217;ll be looking at heaps - which are used to find the maximum or minimum elements of a list of elements in the fastest time. </p><p>This sounds very &#8230; limited and you&#8217;re not exactly wrong if you think that way. When I first learnt about heaps, I thought that they were rather useless. After all, why care about finding the maximum or minimum element in a list of elements when we could just sort the list or just traverse the list to find the largest/smallest element.</p><p>Before starting on the rest of this article, I highly suggest going through our previous articles on</p><ol><li><p> <a href="https://bowtiedhamachi.substack.com/p/comparing-algorithms">Algorithmic Complexity</a> - to understand what Big O Notation is</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/binary-search-trees">Binary Search Trees</a> - to understand why a heap is not a binary search tree even though it looks like one</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/arrays">Arrays</a> - to understand how index notation works when we use an array to represent our heap</p></li></ol><p>So, why use heaps?</p><p><strong>The short answer to that is heaps can help us find a maximum and minimum element in a constant amount of time - since this is always the root node</strong>. Even when we add in a new element or delete existing ones, we will only need O(log(n)) time to rebalance the heap.</p><blockquote><p><strong><br>Fun Tidbit : </strong>I found this interesting Quora answer when trying to find some real-life applications of heaps : https://www.quora.com/What-are-some-real-world-applications-of-a-heap-data-structure, worth a look!<br></p></blockquote><p>If we were to use a traditional array or linked list, we would have to use O(n) since we would need to go through every element in the array, perform a comparison. When we add or delete elements in our array, this runtime doesn&#8217;t change.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Here&#8217;s a quick graph to visualise the difference between log(n) and n as the size of n increase from 0 to 1000 elements. It&#8217;s quite drastic to say the least, with the difference growing significantly as the number of elements grow.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rc7J!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rc7J!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 424w, https://substackcdn.com/image/fetch/$s_!rc7J!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 848w, https://substackcdn.com/image/fetch/$s_!rc7J!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 1272w, https://substackcdn.com/image/fetch/$s_!rc7J!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rc7J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png" width="431" height="207" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:207,&quot;width&quot;:431,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:11228,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rc7J!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 424w, https://substackcdn.com/image/fetch/$s_!rc7J!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 848w, https://substackcdn.com/image/fetch/$s_!rc7J!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 1272w, https://substackcdn.com/image/fetch/$s_!rc7J!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c9846b7-849a-4751-9ad5-2813e49f12d4_431x207.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>I hope this has piqued your curiosity about heaps - so without ado let&#8217;s start delving into them. </p><blockquote><p>Note : In this article, we&#8217;ll be covering binary heaps only. We won&#8217;t be covering heaps with more than two child nodes since they are out of scope for this topic and a tad bit more complex and rare.<br><br>We&#8217;ll be looking at an implementation of a heap using arrays in the following weeks - this week is just a high level overview.</p></blockquote><h1>Introduction</h1><h2>Parent Nodes and Child Nodes</h2><p>Two weeks ago, we covered Binary Search Trees - where we look at the nodes that look like what we have below.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qisv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qisv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 424w, https://substackcdn.com/image/fetch/$s_!Qisv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 848w, https://substackcdn.com/image/fetch/$s_!Qisv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 1272w, https://substackcdn.com/image/fetch/$s_!Qisv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qisv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png" width="424" height="293" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:293,&quot;width&quot;:424,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19763,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Qisv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 424w, https://substackcdn.com/image/fetch/$s_!Qisv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 848w, https://substackcdn.com/image/fetch/$s_!Qisv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 1272w, https://substackcdn.com/image/fetch/$s_!Qisv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9020498a-6d3f-4b61-b1ea-305efd0050e2_424x293.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If we were to designate 56 as a parent node, then 30 and 70 would be its child nodes. If we were to blow up our binary search tree and add a few more elements, we can see that there can be multiple parent nodes in the same tree.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s_mJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s_mJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 424w, https://substackcdn.com/image/fetch/$s_!s_mJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 848w, https://substackcdn.com/image/fetch/$s_!s_mJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!s_mJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s_mJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg" width="426" height="267.2181818181818" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:414,&quot;width&quot;:660,&quot;resizeWidth&quot;:426,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Parent nodes in a tree.&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Parent nodes in a tree." title="Parent nodes in a tree." srcset="https://substackcdn.com/image/fetch/$s_!s_mJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 424w, https://substackcdn.com/image/fetch/$s_!s_mJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 848w, https://substackcdn.com/image/fetch/$s_!s_mJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!s_mJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fb5582f-b913-43bf-8373-6400999a6c8f_660x414.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>This makes sense since parent and child nodes are <strong>just terms we use to identify a relationship between individual nodes.</strong> This is an important concept to understand.</p><h2>Applying this to Heaps</h2><p>So how does this apply to a binary heap?</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/heaps-part-i">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Graphs]]></title><description><![CDATA[One of the most flexible data structures there is]]></description><link>https://bowtiedhamachi.substack.com/p/graphs</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/graphs</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 24 Dec 2022 14:27:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!QdiT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome to Think Like A Programmer, where we break down complicated computer science concepts into bite-sized articles for you. In today&#8217;s article, we&#8217;ll be looking at graphs - a data structure which can be used to represent connections or relationships between different objects.</p><p>Personally, I think graphs are extremely useful in computer science - and they&#8217;re probably significantly more useful than you think!</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h2>Analogy</h2><p>Imagine you&#8217;re going to a new theme park and you see the following map</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QdiT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QdiT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 424w, https://substackcdn.com/image/fetch/$s_!QdiT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 848w, https://substackcdn.com/image/fetch/$s_!QdiT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 1272w, https://substackcdn.com/image/fetch/$s_!QdiT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QdiT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png" width="630" height="315" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:630,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Theme Park Map Amusement Day Out Building Maths KS2&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Theme Park Map Amusement Day Out Building Maths KS2" title="Theme Park Map Amusement Day Out Building Maths KS2" srcset="https://substackcdn.com/image/fetch/$s_!QdiT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 424w, https://substackcdn.com/image/fetch/$s_!QdiT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 848w, https://substackcdn.com/image/fetch/$s_!QdiT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 1272w, https://substackcdn.com/image/fetch/$s_!QdiT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F95bd67b6-d4b9-4620-99ed-71a895b46601_630x315.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>We can mark out potential places of interest with a circle as seen below. In this example, I&#8217;ve chosen 5 random places and marked them out.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!W0I_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W0I_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 424w, https://substackcdn.com/image/fetch/$s_!W0I_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 848w, https://substackcdn.com/image/fetch/$s_!W0I_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 1272w, https://substackcdn.com/image/fetch/$s_!W0I_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W0I_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png" width="388" height="258.51140456182475" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:555,&quot;width&quot;:833,&quot;resizeWidth&quot;:388,&quot;bytes&quot;:599201,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!W0I_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 424w, https://substackcdn.com/image/fetch/$s_!W0I_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 848w, https://substackcdn.com/image/fetch/$s_!W0I_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 1272w, https://substackcdn.com/image/fetch/$s_!W0I_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F46aeef36-e965-47b5-94db-d02e1fac0c7f_833x555.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>There are also some roads that connect the individual attraction so let&#8217;s use some lines to represent these roads</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LTJL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LTJL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 424w, https://substackcdn.com/image/fetch/$s_!LTJL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 848w, https://substackcdn.com/image/fetch/$s_!LTJL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 1272w, https://substackcdn.com/image/fetch/$s_!LTJL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LTJL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png" width="526" height="325.6190476190476" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:520,&quot;width&quot;:840,&quot;resizeWidth&quot;:526,&quot;bytes&quot;:606692,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!LTJL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 424w, https://substackcdn.com/image/fetch/$s_!LTJL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 848w, https://substackcdn.com/image/fetch/$s_!LTJL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 1272w, https://substackcdn.com/image/fetch/$s_!LTJL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F15c42b02-fbf8-4d04-8b1d-dfcecf310197_840x520.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>Each line here represents a direct path that connects the two nodes <strong>without going through another attraction</strong></p></blockquote><p>Now that we have this specific representation, what can we do with it?</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/graphs">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Binary Search Trees]]></title><description><![CDATA[Hey guys, thanks so much for reading Think Like A Programmer where we break down complicated computer science concepts in bite-sized articles.]]></description><link>https://bowtiedhamachi.substack.com/p/binary-search-trees</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/binary-search-trees</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 17 Dec 2022 14:30:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!GZ_C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey guys, thanks so much for reading Think Like A Programmer where we break down complicated computer science concepts in bite-sized articles. In this week&#8217;s article, we&#8217;ll look at binary search trees - a useful data structure to filter and search for data in a convenient way.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Before starting on today&#8217;s topic, I highly suggest looking at our previous articles on</p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/arrays">Arrays</a> </p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/linked-lists">Linked Lists</a> </p><p></p></li></ol><h1>Analogy</h1><p>Ever tried finding a book in a unsorted bookshelf? It&#8217;s pretty hard to find anything at all if the books aren&#8217;t sorted out nicely at all.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GZ_C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GZ_C!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 424w, https://substackcdn.com/image/fetch/$s_!GZ_C!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 848w, https://substackcdn.com/image/fetch/$s_!GZ_C!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 1272w, https://substackcdn.com/image/fetch/$s_!GZ_C!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GZ_C!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif" width="480" height="415" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/d5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:415,&quot;width&quot;:480,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Searching Got You GIF by grantkoltoons&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Searching Got You GIF by grantkoltoons" title="Searching Got You GIF by grantkoltoons" srcset="https://substackcdn.com/image/fetch/$s_!GZ_C!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 424w, https://substackcdn.com/image/fetch/$s_!GZ_C!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 848w, https://substackcdn.com/image/fetch/$s_!GZ_C!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 1272w, https://substackcdn.com/image/fetch/$s_!GZ_C!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5c46dce-f758-4eb4-a003-617bbe8be732_480x415.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Most times, you&#8217;ll need to sieve through the books one by one until you find what you&#8217;re looking for and if you happen to accidentally gloss over the book that you want - good luck starting from the top.</p><p>That&#8217;s why most bookshelves are sorted out in a alphabetical order - you have the books that start with an A before those that start with a Z.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-C_u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-C_u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-C_u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-C_u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-C_u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-C_u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What's the fastest way to alphabetize your bookshelf? - Chand John - YouTube&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What's the fastest way to alphabetize your bookshelf? - Chand John - YouTube" title="What's the fastest way to alphabetize your bookshelf? - Chand John - YouTube" srcset="https://substackcdn.com/image/fetch/$s_!-C_u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-C_u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-C_u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-C_u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F498b362b-0943-4b7b-97bf-9dc733dcd31c_1280x720.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><p>As we covered in our previous article on comparing algorithms, having an alphabetically ordered list of books means that we can reduce our search space. </p><p>Intuitively, If we&#8217;re looking for a book with a name that begins with a M, we&#8217;re not going to start looking for the book in the section with books that begin with Z. </p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:81916377,&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/p/comparing-algorithms&quot;,&quot;publication_id&quot;:1060188,&quot;publication_name&quot;:&quot;Think Like A Programmer&quot;,&quot;publication_logo_url&quot;:null,&quot;title&quot;:&quot;Comparing Algorithms&quot;,&quot;truncated_body_text&quot;:&quot;Hello anon! It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the third paid article in our Substack. I&#8217;ve also added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way.&quot;,&quot;date&quot;:&quot;2022-11-05T14:30:08.325Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:102427036,&quot;name&quot;:&quot;BowTiedHamachi&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f895ffe-b4f1-4a67-a996-3ee6e85e10d0_144x144.png&quot;,&quot;bio&quot;:&quot;New to the jungle, learning and documenting my journey along the way&quot;,&quot;profile_set_up_at&quot;:&quot;2022-08-25T12:30:45.366Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1008120,&quot;user_id&quot;:102427036,&quot;publication_id&quot;:1060188,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:1060188,&quot;name&quot;:&quot;Think Like A Programmer&quot;,&quot;subdomain&quot;:&quot;bowtiedhamachi&quot;,&quot;custom_domain&quot;:null,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Breaking down computer stuff so that even a 3 year old can understand&quot;,&quot;logo_url&quot;:null,&quot;author_id&quot;:102427036,&quot;theme_var_background_pop&quot;:&quot;#EA410B&quot;,&quot;created_at&quot;:&quot;2022-08-25T12:31:45.159Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:null,&quot;copyright&quot;:&quot;BowTiedHamachi&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;BowTiedHamachi&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;,&quot;source&quot;:null}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://bowtiedhamachi.substack.com/p/comparing-algorithms?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><span></span><span class="embedded-post-publication-name">Think Like A Programmer</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Comparing Algorithms</div></div><div class="embedded-post-body">Hello anon! It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the third paid article in our Substack. I&#8217;ve also added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">4 years ago &#183; BowTiedHamachi</div></a></div><p>What happens then as our collection of books gets larger and larger? Well, the most intuitive thing then is to simply start categorising collections according to subject. Each collection is then sorted alphabetically.</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/binary-search-trees">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Queues]]></title><description><![CDATA[or how to spot delicious food and opportunities on holiday]]></description><link>https://bowtiedhamachi.substack.com/p/queues</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/queues</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 10 Dec 2022 15:30:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!D334!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Welcome back anon to Think Like A Programmer where we break down complex computer science concepts in simple short essays. </p><p>In the past few weeks, we&#8217;ve covered a good amount of ground - algorithmic complexity, arrays and linked lists just to name a few. If you haven&#8217;t checked it out, I suggest that you give them a quick read.</p><p>This week, we&#8217;ll look at queues - specifically why they&#8217;re important and how we might be able to implement them. We&#8217;ll cover an analogy that showcases how they might be useful before looking at some of their real-life use-cases. </p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><h1>Story</h1><p>You&#8217;re the owner of a big and popular bakery in the middle of town and you&#8217;ve got a problem - too many customers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!D334!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!D334!,w_424,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 424w, https://substackcdn.com/image/fetch/$s_!D334!,w_848,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 848w, https://substackcdn.com/image/fetch/$s_!D334!,w_1272,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 1272w, https://substackcdn.com/image/fetch/$s_!D334!,w_1456,c_limit,f_webp,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!D334!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif" width="304" height="304" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/c6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:480,&quot;resizeWidth&quot;:304,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Black Friday Animation GIF by HBO Max&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Black Friday Animation GIF by HBO Max" title="Black Friday Animation GIF by HBO Max" srcset="https://substackcdn.com/image/fetch/$s_!D334!,w_424,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 424w, https://substackcdn.com/image/fetch/$s_!D334!,w_848,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 848w, https://substackcdn.com/image/fetch/$s_!D334!,w_1272,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 1272w, https://substackcdn.com/image/fetch/$s_!D334!,w_1456,c_limit,f_auto,q_auto:good,fl_lossy/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc6e3f3f7-ac58-4c72-a312-7edfe3ac4faf_480x480.gif 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Before you know it, the store is overflowing with customers everyday and people are getting annoyed. Sometimes it takes minutes to get a delicious brioche while other days it takes hours to get their fix. </p><p>To make matters worse, your staff tend to get overwhelmed with the people screaming at them for their orders. They frequently get the order wrong and customers are understandably frustrated.</p><p> <strong>The service isn&#8217;t consistent in terms of quality or process.</strong></p><h2>Single Queue</h2><p>One day, you get the bright idea to implement a queue - everyone gets themselves a queue number when they arrive in the store and that determines the order that they get served in. </p><blockquote><p>In a queue, the first person to join the queue is able to get their order served first. <strong>In other words, the first person in the queue is the first person out of it.</strong> Queues are therefore an example of a First In, First Out (FIFO) data structure.<br><br>If we used a <a href="https://bowtiedhamachi.substack.com/p/stacks">stack based approach</a> like we covered last week, then we would probably get significantly more customer complaints :/</p></blockquote><p>( Excuse the poor drawing below )</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K3-h!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K3-h!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 424w, https://substackcdn.com/image/fetch/$s_!K3-h!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 848w, https://substackcdn.com/image/fetch/$s_!K3-h!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 1272w, https://substackcdn.com/image/fetch/$s_!K3-h!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K3-h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png" width="369" height="402" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/c2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:402,&quot;width&quot;:369,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:20398,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!K3-h!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 424w, https://substackcdn.com/image/fetch/$s_!K3-h!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 848w, https://substackcdn.com/image/fetch/$s_!K3-h!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 1272w, https://substackcdn.com/image/fetch/$s_!K3-h!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2f87de0-dd4f-4d79-8d15-8c16b052ce5f_369x402.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The new flow helps tremendously and customers are now served in the order that they come in. As long as they get a queue number, they can roughly estimate how long it&#8217;ll take for them to get their order. </p><p>Because you&#8217;re now serving customers in a fixed order, you can now afford to take some time with each order and wrong orders are soon relatively rare. This allows you to start noticing that <strong>some of your customers only order your sourdough loaves, nothing else.</strong> </p><h2>Separate Queues</h2><p>As a result, you decide to run a small experiment and set up a separate counter that only sells sourdough loaves. This results in a new setup as seen below where a separate queue is provided </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GFPk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GFPk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 424w, https://substackcdn.com/image/fetch/$s_!GFPk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 848w, https://substackcdn.com/image/fetch/$s_!GFPk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 1272w, https://substackcdn.com/image/fetch/$s_!GFPk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GFPk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png" width="354" height="450" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/c7afa249-04c1-492b-a7c5-332e8115b096_354x450.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:450,&quot;width&quot;:354,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:23538,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GFPk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 424w, https://substackcdn.com/image/fetch/$s_!GFPk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 848w, https://substackcdn.com/image/fetch/$s_!GFPk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 1272w, https://substackcdn.com/image/fetch/$s_!GFPk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fc7afa249-04c1-492b-a7c5-332e8115b096_354x450.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After running this experiment for a few weeks, customers are now happier because wait times have decreased. They can now get their bread quicker and not have to squeeze and jostle like in the past. </p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/queues">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Stacks]]></title><description><![CDATA[Or how people normally cook a meal]]></description><link>https://bowtiedhamachi.substack.com/p/stacks</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/stacks</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 03 Dec 2022 15:30:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!80HZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F90d69581-3382-491e-a7ab-a35bb98bd205_620x870.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey guys, thanks so much for reading Think Like A Programmer where we break down complicated computer science concepts in bite-sized articles. In this week&#8217;s article, we&#8217;ll look at stacks -  a data structure you&#8217;re probably using in your day to day life without even realising it.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>Before starting on today&#8217;s topic, I highly suggest looking at our previous articles on</p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/arrays">Arrays</a> - For a quick overview on how memory works under the hood</p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/linked-lists">Linked Lists</a> - For an idea of how we can efficiently work with memory when we&#8217;re not sure of the amount of items we&#8217;d need in advance</p></li></ol><p>before proceeding. This will ensure that you get a good understanding of what benefits a stack brings to the table and why it&#8217;s used so frequently in a variety of different languages.</p><h1>Analogy Time</h1><p>If you&#8217;ve ever tried to cook a dish, you know that things rarely go to plan. Let&#8217;s take a simple omelette for example. Every recipe normally goes something like this</p><ol><li><p>Crack some eggs and put them into a bowl</p></li><li><p>Heat up a pan with medium heat and throw in a generous stick of butter</p></li><li><p>Pour your egg inside</p></li><li><p>A perfect omelette is born</p></li></ol><p>However, what normally ends up happening in my case, is that</p><ol><li><p>Crack some eggs </p></li><li><p>Realise that I&#8217;ve dropped some egg shells into the bowl</p></li><li><p>Find a small spoon in the cupboard</p></li><li><p>Try to scoop out some of the egg shells</p></li><li><p>Rinse off the egg whites on the spoon</p></li></ol><p>and so on&#8230; </p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/stacks">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Dynamic Arrays]]></title><description><![CDATA[The compromise you've never heard about but use all the time.]]></description><link>https://bowtiedhamachi.substack.com/p/dynamic-arrays</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/dynamic-arrays</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 26 Nov 2022 14:30:58 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!mP-j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F842f77ba-1d00-41dd-aba3-ca6611ada97e_495x392.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1>Introduction</h1><p>Hey there, hope you&#8217;re having a good thanksgiving no matter which part of the world you&#8217;re in. </p><p>If you&#8217;re still on the fence about subscribing, gentle reminder that we&#8217;re holding a thanksgiving promotion that ends this Sunday. We&#8217;ve got a lot of good articles coming up in the next few months - from data structures, to front-end programming and walkthroughs on programming challenges. </p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?coupon=9644acde&quot;,&quot;text&quot;:&quot;Get 20% off for 1 year&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://bowtiedhamachi.substack.com/subscribe?coupon=9644acde"><span>Get 20% off for 1 year</span></a></p><p>Before starting on today&#8217;s topic, I highly suggest looking at our previous articles on</p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/arrays">Arrays</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/linked-lists">Linked Lists</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/comparing-algorithms">Comparing Algorithms</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/interfaces-and-data-structures">Interfaces</a></p></li></ol><p>This will ensure that you get a good understanding of what benefits a dynamic array brings to the table and why it&#8217;s used so frequently in a variety of different languages. </p><blockquote><p><strong>Summary : </strong>The intuition behind a dynamic array is really simple - the moment we reach a certain capacity limit, we expand. </p></blockquote><h1>Traditional vs Dynamic Arrays</h1><p>Let&#8217;s start by creating a little array with enough space for 4 elements. Notice that it currently only has 3 elements. </p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WFMd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WFMd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 424w, https://substackcdn.com/image/fetch/$s_!WFMd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 848w, https://substackcdn.com/image/fetch/$s_!WFMd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 1272w, https://substackcdn.com/image/fetch/$s_!WFMd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WFMd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png" width="278" height="199" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/e118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:199,&quot;width&quot;:278,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33814,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WFMd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 424w, https://substackcdn.com/image/fetch/$s_!WFMd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 848w, https://substackcdn.com/image/fetch/$s_!WFMd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 1272w, https://substackcdn.com/image/fetch/$s_!WFMd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2Fe118fc23-5ffa-4364-b370-56f1d2f0f24e_278x199.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The moment we add a fourth element into our array, we&#8217;re out of space.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!57gR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!57gR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 424w, https://substackcdn.com/image/fetch/$s_!57gR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 848w, https://substackcdn.com/image/fetch/$s_!57gR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 1272w, https://substackcdn.com/image/fetch/$s_!57gR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!57gR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png" width="258" height="183" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:183,&quot;width&quot;:258,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:33588,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!57gR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 424w, https://substackcdn.com/image/fetch/$s_!57gR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 848w, https://substackcdn.com/image/fetch/$s_!57gR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 1272w, https://substackcdn.com/image/fetch/$s_!57gR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F19888fca-f267-4da6-9982-72e58eb33cb3_258x183.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Traditional arrays cannot be resized. The moment you use up the array&#8217;s capacity, you&#8217;re done. But that&#8217;s where dynamic arrays come in, you simply allocate more space and copy the original elements over using the following steps before inserting in the new element.</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/dynamic-arrays">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Happy Thanksgiving!]]></title><description><![CDATA[I&#8217;ve been writing this newsletter for a solid 2 months now and I&#8217;m very thankful to all the readers of the newsletter.]]></description><link>https://bowtiedhamachi.substack.com/p/happy-thanksgiving</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/happy-thanksgiving</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Fri, 25 Nov 2022 01:29:59 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aPsP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I&#8217;ve been writing this newsletter for a solid 2 months now and I&#8217;m very thankful to all the readers of the newsletter. </p><p>It means a lot to me that there are people willing to subscribe and read my weekly articles and I appreciate every single one of you. I had been debating whether or not to do this newsletter for the longest time and I&#8217;m so glad I took the plunge.</p><p>We&#8217;ve got a lot of high quality posts coming over the next few months and a paid subscription will give you access to all of them. If you&#8217;ve been debating whether or not to break into tech, I&#8217;m confident that the articles will give you a solid foundation to beat out the competition.</p><p>This week&#8217;s post will drop a little later due to the thanksgiving holiday but look forward to another high quality one.</p><p>In light of Thanksgiving, I&#8217;ve added a 20% discount which will run till this weekend.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?coupon=9644acde&quot;,&quot;text&quot;:&quot;Get 20% off for 1 year&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://bowtiedhamachi.substack.com/subscribe?coupon=9644acde"><span>Get 20% off for 1 year</span></a></p><p>Have a great thanksgiving ahead!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aPsP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aPsP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aPsP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aPsP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aPsP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aPsP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg" width="1456" height="1456" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1456,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Free Free Thanksgiving Poster Vector - EPS, Illustrator, JPG, PNG, SVG |  Template.net&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Free Free Thanksgiving Poster Vector - EPS, Illustrator, JPG, PNG, SVG |  Template.net" title="Free Free Thanksgiving Poster Vector - EPS, Illustrator, JPG, PNG, SVG |  Template.net" srcset="https://substackcdn.com/image/fetch/$s_!aPsP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 424w, https://substackcdn.com/image/fetch/$s_!aPsP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 848w, https://substackcdn.com/image/fetch/$s_!aPsP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!aPsP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4e5fc6bf-91b4-4390-83a1-677d9a62c52e_2134x2134.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Interfaces versus Data Structures]]></title><description><![CDATA[Another layer of abstraction strikes again]]></description><link>https://bowtiedhamachi.substack.com/p/interfaces-and-data-structures</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/interfaces-and-data-structures</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 19 Nov 2022 14:32:45 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 424w, https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 848w, https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1272w, https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" width="1000" height="667" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:667,&quot;width&quot;:1000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;yellow click pen on white printer paper&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="yellow click pen on white printer paper" title="yellow click pen on white printer paper" srcset="https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 424w, https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 848w, https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1272w, https://images.unsplash.com/photo-1581291518633-83b4ebd1d83e?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Introduction</h1><p>Hey there Anon, welcome back to Think Like A Programmer. In this week&#8217;s article, we look at the difference between an interface and a data structure. Many people confuse the two and clearing up the difference between the two is vital.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p>For the past two weeks, we covered two different data structures - Arrays and Linked Lists. If you haven&#8217;t read them yet, I suggest that you check them out so that the subsequent section of this article will make more sense.</p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:77532215,&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/p/arrays&quot;,&quot;publication_id&quot;:1060188,&quot;publication_name&quot;:&quot;Think Like A Programmer&quot;,&quot;publication_logo_url&quot;:null,&quot;title&quot;:&quot;Arrays&quot;,&quot;truncated_body_text&quot;:&quot;Introduction This is the second paid post in this substack&#8217;s history! We&#8217;ve got a good amount of content lined up, especially for data structures and stay tuned for more good content to come. I&#8217;ve added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way&quot;,&quot;date&quot;:&quot;2022-10-30T15:30:59.747Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:102427036,&quot;name&quot;:&quot;BowTiedHamachi&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f895ffe-b4f1-4a67-a996-3ee6e85e10d0_144x144.png&quot;,&quot;bio&quot;:&quot;New to the jungle, learning and documenting my journey along the way&quot;,&quot;profile_set_up_at&quot;:&quot;2022-08-25T12:30:45.366Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1008120,&quot;user_id&quot;:102427036,&quot;publication_id&quot;:1060188,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:1060188,&quot;name&quot;:&quot;Think Like A Programmer&quot;,&quot;subdomain&quot;:&quot;bowtiedhamachi&quot;,&quot;custom_domain&quot;:null,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Breaking down computer stuff so that even a 3 year old can understand&quot;,&quot;logo_url&quot;:null,&quot;author_id&quot;:102427036,&quot;theme_var_background_pop&quot;:&quot;#EA410B&quot;,&quot;created_at&quot;:&quot;2022-08-25T12:31:45.159Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:null,&quot;copyright&quot;:&quot;BowTiedHamachi&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;BowTiedHamachi&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:false,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;,&quot;source&quot;:null}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://bowtiedhamachi.substack.com/p/arrays?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><span></span><span class="embedded-post-publication-name">Think Like A Programmer</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Arrays</div></div><div class="embedded-post-body">Introduction This is the second paid post in this substack&#8217;s history! We&#8217;ve got a good amount of content lined up, especially for data structures and stay tuned for more good content to come. I&#8217;ve added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">4 years ago &#183; BowTiedHamachi</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:83097814,&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/p/linked-lists&quot;,&quot;publication_id&quot;:1060188,&quot;publication_name&quot;:&quot;Think Like A Programmer&quot;,&quot;publication_logo_url&quot;:null,&quot;title&quot;:&quot;Linked -> Lists&quot;,&quot;truncated_body_text&quot;:&quot;Hey anon! It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the fourth paid article in our Substack. As usual, we're still running the 7 day free trial promotion that will allow you to get access to the content below which will give you a quick glance at what is on the way. This will end soon so do seize the opportunity to check out what&#8217;s behind the paywall~&quot;,&quot;date&quot;:&quot;2022-11-12T13:37:37.192Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:102427036,&quot;name&quot;:&quot;BowTiedHamachi&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f895ffe-b4f1-4a67-a996-3ee6e85e10d0_144x144.png&quot;,&quot;bio&quot;:&quot;New to the jungle, learning and documenting my journey along the way&quot;,&quot;profile_set_up_at&quot;:&quot;2022-08-25T12:30:45.366Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1008120,&quot;user_id&quot;:102427036,&quot;publication_id&quot;:1060188,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:1060188,&quot;name&quot;:&quot;Think Like A Programmer&quot;,&quot;subdomain&quot;:&quot;bowtiedhamachi&quot;,&quot;custom_domain&quot;:null,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Breaking down computer stuff so that even a 3 year old can understand&quot;,&quot;logo_url&quot;:null,&quot;author_id&quot;:102427036,&quot;theme_var_background_pop&quot;:&quot;#EA410B&quot;,&quot;created_at&quot;:&quot;2022-08-25T12:31:45.159Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:null,&quot;copyright&quot;:&quot;BowTiedHamachi&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;BowTiedHamachi&quot;,&quot;is_guest&quot;:false,&quot;bestseller_tier&quot;:null}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:false,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;,&quot;source&quot;:null}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://bowtiedhamachi.substack.com/p/linked-lists?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><span></span><span class="embedded-post-publication-name">Think Like A Programmer</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Linked -&gt; Lists</div></div><div class="embedded-post-body">Hey anon! It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the fourth paid article in our Substack. As usual, we're still running the 7 day free trial promotion that will allow you to get access to the content below which will give you a quick glance at what is on the way. This will end soon so do seize the opportunity to check out what&#8217;s behind the paywall&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">4 years ago &#183; BowTiedHamachi</div></a></div><h1>Interfaces vs Data Structures<br></h1><blockquote><p>To put it simply, an interface is the list of operations that we can perform. A data structure on the other hand, is the implementation under the good to make those operations possible.</p></blockquote><p></p><p>To make this point more explicit, let&#8217;s consider a more abstract example. </p><p>Let&#8217;s imagine that you invent a messaging system so that you can keep your colleagues updated with what&#8217;s happening in the latest projects.</p><p>This system needs to allow you to do two things</p><ul><li><p>send a message</p></li><li><p>receive a message</p></li></ul><p>This is its interface.</p><p>Now there are many ways that we could implement it but let&#8217;s look at two possible ways.</p><h3>Manual Labor</h3><p>We could implement this with some help from some unfortunate victims in the following manner. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!io4N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!io4N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 424w, https://substackcdn.com/image/fetch/$s_!io4N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 848w, https://substackcdn.com/image/fetch/$s_!io4N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 1272w, https://substackcdn.com/image/fetch/$s_!io4N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!io4N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png" width="426" height="294.3511293634497" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8431de4b-ba52-4033-94dd-55751deb0859_974x673.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:673,&quot;width&quot;:974,&quot;resizeWidth&quot;:426,&quot;bytes&quot;:31845,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!io4N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 424w, https://substackcdn.com/image/fetch/$s_!io4N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 848w, https://substackcdn.com/image/fetch/$s_!io4N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 1272w, https://substackcdn.com/image/fetch/$s_!io4N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8431de4b-ba52-4033-94dd-55751deb0859_974x673.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Let&#8217;s imagine that the office has 4 tables like the image you see above. The tables are far enough that you can&#8217;t shout to one another whatever you want to say. So, whenever you want to send a message across to your colleagues, you </p><ol><li><p>Call a messenger over</p></li><li><p>Hand him your note</p></li><li><p>Watch as he runs over to the table of your choice</p></li></ol><p>With that we&#8217;ve implemented a way to send messages. </p><p>Receiving messages is relatively straightforward - if you see someone running towards your table and calling your name, you&#8217;re about to receive a message.</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/interfaces-and-data-structures">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Linked -> Lists]]></title><description><![CDATA[The pesky to-> do list strikes back]]></description><link>https://bowtiedhamachi.substack.com/p/linked-lists</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/linked-lists</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 12 Nov 2022 13:37:37 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080" width="1080" height="720" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 424w, https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 848w, https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1272w, https://images.unsplash.com/photo-1592458980314-f2e64c3c9d6c?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwzMDAzMzh8MHwxfHNlYXJjaHwxMnx8YXJyb3dzJTIwcG9pbnRpbmd8ZW58MHx8fHwxNjY3OTIxMjY2&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=1080 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Photo by <a href="https://unsplash.com/@timmossholder">Tim Mossholder</a> on <a href="https://unsplash.com">Unsplash</a></figcaption></figure></div><p></p><p>Hey anon! </p><p>It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the fourth paid article in our Substack. </p><p>As usual, we're still running the 7 day free trial promotion that will allow you to get access to the content below which will give you a quick glance at what is on the way. This will end soon so do seize the opportunity to check out what&#8217;s behind the paywall~</p><h1>Intuition</h1><p>Today we're back with another metaphor for a linked list. Hopefully, after this longer story you'll be able to get a better idea of what a Linked List is. This follows our previous two articles on arrays and comparing algorithms and builds upon them.</p><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:77532215,&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/p/arrays&quot;,&quot;publication_id&quot;:1060188,&quot;publication_name&quot;:&quot;Think Like A Programmer&quot;,&quot;publication_logo_url&quot;:null,&quot;title&quot;:&quot;Arrays&quot;,&quot;truncated_body_text&quot;:&quot;Introduction This is the second paid post in this substack&#8217;s history! We&#8217;ve got a good amount of content lined up, especially for data structures and stay tuned for more good content to come. I&#8217;ve added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way&quot;,&quot;date&quot;:&quot;2022-10-30T15:30:59.747Z&quot;,&quot;like_count&quot;:1,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:102427036,&quot;name&quot;:&quot;BowTiedHamachi&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f895ffe-b4f1-4a67-a996-3ee6e85e10d0_144x144.png&quot;,&quot;bio&quot;:&quot;New to the jungle, learning and documenting my journey along the way&quot;,&quot;profile_set_up_at&quot;:&quot;2022-08-25T12:30:45.366Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1008120,&quot;user_id&quot;:102427036,&quot;publication_id&quot;:1060188,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:1060188,&quot;name&quot;:&quot;Think Like A Programmer&quot;,&quot;subdomain&quot;:&quot;bowtiedhamachi&quot;,&quot;custom_domain&quot;:null,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Breaking down computer stuff so that even a 3 year old can understand&quot;,&quot;logo_url&quot;:null,&quot;author_id&quot;:102427036,&quot;theme_var_background_pop&quot;:&quot;#EA410B&quot;,&quot;created_at&quot;:&quot;2022-08-25T12:31:45.159Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:null,&quot;copyright&quot;:&quot;BowTiedHamachi&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;BowTiedHamachi&quot;,&quot;is_guest&quot;:false}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:false,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;,&quot;source&quot;:null}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://bowtiedhamachi.substack.com/p/arrays?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><span></span><span class="embedded-post-publication-name">Think Like A Programmer</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Arrays</div></div><div class="embedded-post-body">Introduction This is the second paid post in this substack&#8217;s history! We&#8217;ve got a good amount of content lined up, especially for data structures and stay tuned for more good content to come. I&#8217;ve added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">4 years ago &#183; 1 like &#183; BowTiedHamachi</div></a></div><div class="embedded-post-wrap" data-attrs="{&quot;id&quot;:81916377,&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/p/comparing-algorithms&quot;,&quot;publication_id&quot;:1060188,&quot;publication_name&quot;:&quot;Think Like A Programmer&quot;,&quot;publication_logo_url&quot;:null,&quot;title&quot;:&quot;Comparing Algorithms&quot;,&quot;truncated_body_text&quot;:&quot;Hello anon! It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the third paid article in our Substack. I&#8217;ve also added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way.&quot;,&quot;date&quot;:&quot;2022-11-05T14:30:08.325Z&quot;,&quot;like_count&quot;:0,&quot;comment_count&quot;:0,&quot;bylines&quot;:[{&quot;id&quot;:102427036,&quot;name&quot;:&quot;BowTiedHamachi&quot;,&quot;previous_name&quot;:null,&quot;photo_url&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8f895ffe-b4f1-4a67-a996-3ee6e85e10d0_144x144.png&quot;,&quot;bio&quot;:&quot;New to the jungle, learning and documenting my journey along the way&quot;,&quot;profile_set_up_at&quot;:&quot;2022-08-25T12:30:45.366Z&quot;,&quot;publicationUsers&quot;:[{&quot;id&quot;:1008120,&quot;user_id&quot;:102427036,&quot;publication_id&quot;:1060188,&quot;role&quot;:&quot;admin&quot;,&quot;public&quot;:true,&quot;is_primary&quot;:false,&quot;publication&quot;:{&quot;id&quot;:1060188,&quot;name&quot;:&quot;Think Like A Programmer&quot;,&quot;subdomain&quot;:&quot;bowtiedhamachi&quot;,&quot;custom_domain&quot;:null,&quot;custom_domain_optional&quot;:false,&quot;hero_text&quot;:&quot;Breaking down computer stuff so that even a 3 year old can understand&quot;,&quot;logo_url&quot;:null,&quot;author_id&quot;:102427036,&quot;theme_var_background_pop&quot;:&quot;#EA410B&quot;,&quot;created_at&quot;:&quot;2022-08-25T12:31:45.159Z&quot;,&quot;rss_website_url&quot;:null,&quot;email_from_name&quot;:null,&quot;copyright&quot;:&quot;BowTiedHamachi&quot;,&quot;founding_plan_name&quot;:&quot;Founding Member&quot;,&quot;community_enabled&quot;:true,&quot;invite_only&quot;:false,&quot;payments_state&quot;:&quot;enabled&quot;}}],&quot;twitter_screen_name&quot;:&quot;BowTiedHamachi&quot;,&quot;is_guest&quot;:false}],&quot;utm_campaign&quot;:null,&quot;belowTheFold&quot;:true,&quot;type&quot;:&quot;newsletter&quot;,&quot;language&quot;:&quot;en&quot;,&quot;source&quot;:null}" data-component-name="EmbeddedPostToDOM"><a class="embedded-post" native="true" href="https://bowtiedhamachi.substack.com/p/comparing-algorithms?utm_source=substack&amp;utm_campaign=post_embed&amp;utm_medium=web"><div class="embedded-post-header"><span></span><span class="embedded-post-publication-name">Think Like A Programmer</span></div><div class="embedded-post-title-wrapper"><div class="embedded-post-title">Comparing Algorithms</div></div><div class="embedded-post-body">Hello anon! It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the third paid article in our Substack. I&#8217;ve also added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way&#8230;</div><div class="embedded-post-cta-wrapper"><span class="embedded-post-cta">Read more</span></div><div class="embedded-post-meta">4 years ago &#183; BowTiedHamachi</div></a></div><p>If you haven&#8217;t checked them out, I suggest reading through them to get a better handle of what this article is about. </p><h2>Books Galore</h2><p>I love reading books and my book shelf is always bursting with a whole lot of books. I can't take a picture of it but it looks somewhat like this.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dh2O!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dh2O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 424w, https://substackcdn.com/image/fetch/$s_!dh2O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 848w, https://substackcdn.com/image/fetch/$s_!dh2O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 1272w, https://substackcdn.com/image/fetch/$s_!dh2O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dh2O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png" width="156" height="244.12213740458014" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/4909e09c-896f-4c36-beae-32dd58c13749_262x410.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:410,&quot;width&quot;:262,&quot;resizeWidth&quot;:156,&quot;bytes&quot;:27105,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dh2O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 424w, https://substackcdn.com/image/fetch/$s_!dh2O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 848w, https://substackcdn.com/image/fetch/$s_!dh2O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 1272w, https://substackcdn.com/image/fetch/$s_!dh2O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F4909e09c-896f-4c36-beae-32dd58c13749_262x410.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>With only a few shelves, I started to run out of space pretty soon. This meant that soon, my tidy book shelf went from the nice and tidy space that I have to a messy makeshift arrangement with boxes and boxes on the floor.</p><p></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!V_sX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!V_sX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 424w, https://substackcdn.com/image/fetch/$s_!V_sX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 848w, https://substackcdn.com/image/fetch/$s_!V_sX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 1272w, https://substackcdn.com/image/fetch/$s_!V_sX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!V_sX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png" width="289" height="280.63251670378617" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/99d9ce79-d155-476a-8f9b-49c819614982_449x436.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:436,&quot;width&quot;:449,&quot;resizeWidth&quot;:289,&quot;bytes&quot;:44476,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!V_sX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 424w, https://substackcdn.com/image/fetch/$s_!V_sX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 848w, https://substackcdn.com/image/fetch/$s_!V_sX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 1272w, https://substackcdn.com/image/fetch/$s_!V_sX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F99d9ce79-d155-476a-8f9b-49c819614982_449x436.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I quickly realised that I needed a way to store this rapidly growing collection of books. The problem wasn&#8217;t going away but I figured I could at least store the extra books in one of the rooms in my house - in this case, room 3 is empty so we just throw it into the room.</p><p>It&#8217;s a pretty big house and sometimes it&#8217;s rather difficult to keep track of everything in each room. So I decide to write up the room number that the box is stored on in a stick note and stick it on the shelf. </p><p>Is it a little messy? Yes. <strong>But at least I don't need to buy an expensive new wooden shelf</strong> which would cost me as much as all my books combined. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!n4TW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!n4TW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 424w, https://substackcdn.com/image/fetch/$s_!n4TW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 848w, https://substackcdn.com/image/fetch/$s_!n4TW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 1272w, https://substackcdn.com/image/fetch/$s_!n4TW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!n4TW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png" width="229" height="279.35095137420717" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:577,&quot;width&quot;:473,&quot;resizeWidth&quot;:229,&quot;bytes&quot;:54532,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!n4TW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 424w, https://substackcdn.com/image/fetch/$s_!n4TW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 848w, https://substackcdn.com/image/fetch/$s_!n4TW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 1272w, https://substackcdn.com/image/fetch/$s_!n4TW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F2a9aeaaf-e24c-4604-8194-9ee3e69bcb24_473x577.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>pardon my bad drawing but that box with the arrow pointing elsewhere is in-fact a sticky note with the words Room 3 on it to indicate that the box is stored in room 3.</p></blockquote><p>Pretty much not too long after that, another box gets filled up and we chuck it in another room since room 3 is quite small.</p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/linked-lists">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Comparing Algorithms]]></title><description><![CDATA[How to compare different algorithms using Big O Notation]]></description><link>https://bowtiedhamachi.substack.com/p/comparing-algorithms</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/comparing-algorithms</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sat, 05 Nov 2022 14:30:08 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 424w, https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 848w, https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1272w, https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" width="1000" height="667" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:667,&quot;width&quot;:1000,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;brown and beige weighing scale&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="brown and beige weighing scale" title="brown and beige weighing scale" srcset="https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 424w, https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 848w, https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1272w, https://images.unsplash.com/photo-1612012060851-20f943c02d3d?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Hello anon!</p><p>It&#8217;s been a while since I announced the new paid Substack. Today&#8217;s drop marks the third paid article in our Substack. I&#8217;ve also added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way. </p><h1>Intuition</h1><blockquote><p>I&#8217;m experimenting with a bit more of a simplified story to get the point across here. Slightly more technical explanation is provided after this section.</p></blockquote><h3>Big Pile</h3><p>Let&#8217;s try to build our intuition for algorithms by thinking about finding a book in an imaginary library<strong>.</strong></p><blockquote><p>Recall here that an algorithm is simply a series of steps that we perform to get a  result. You probably use all sorts of algorithms in your daily lives, even spreading peanut butter on a piece of bread involves an algorithm!</p></blockquote><p>Now the librarians are lazy and have unfortunately thrown the books onto the floor. They&#8217;re piled on top of one another and you have no idea what books are in the pile, much less whether or not your desired book exists in this pile.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ifJB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ifJB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 424w, https://substackcdn.com/image/fetch/$s_!ifJB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 848w, https://substackcdn.com/image/fetch/$s_!ifJB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 1272w, https://substackcdn.com/image/fetch/$s_!ifJB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ifJB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png" width="187" height="205" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:205,&quot;width&quot;:187,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19010,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ifJB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 424w, https://substackcdn.com/image/fetch/$s_!ifJB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 848w, https://substackcdn.com/image/fetch/$s_!ifJB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 1272w, https://substackcdn.com/image/fetch/$s_!ifJB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F8b61b9db-4ac8-4216-913b-26a88b42d155_187x205.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>If you were looking for <strong>Dancing Dragon</strong>, then you&#8217;re in luck because it&#8217;s right on top of the pile of books. But if you were looking for <strong>A Big Journey</strong>, you would have to search through all the other books in the pile to find it lying at the bottom. </p><p>This means that at best, we have a single action to perform - picking up the book. But at worst, we have to sift through every single book in the pile.  If we had 10 books in the pile, we would need to sift through 10 books. If we had twenty books, we would need to sift through 20 books. </p>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/comparing-algorithms">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Start Here]]></title><description><![CDATA[An index to refer to!]]></description><link>https://bowtiedhamachi.substack.com/p/start-here</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/start-here</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Wed, 02 Nov 2022 02:52:37 GMT</pubDate><content:encoded><![CDATA[<p>Hi there, BowTiedHamachi here.</p><p>I&#8217;ll be throwing up a lot of new content soon and figured the best way to keep everything organised was to have an index page so that all of the existing and future posts are linked to.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><p><strong>General Programming Knowledge</strong></p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/pure-vs-impure-functions">Pure vs Impure Functions</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/why-the-programming-language-doesnt">Why the programming language doesn&#8217;t matter</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/numerical-representations">Numerical Representations in memory</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/keeping-a-log">Keeping a log - why it matters</a></p></li></ol><p></p><p><strong>Programming Methodology</strong></p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/unit-testing">Unit Testing</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/breaking-down-hard-code">Breaking Down Hard Code</a></p></li></ol><p></p><p><strong>Python</strong></p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/learning-python-1">Part 1 - Getting your development environment set up</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/python-2-your-first-program">Part 2 - What happens when we execute a Python programme</a></p></li></ol><p></p><p><strong>Data Structures</strong></p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/a-brief-gander-into-data-structures">A brief gander into data structures</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/arrays">Arrays</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/linked-lists">Linked Lists</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/interfaces-and-data-structures">Interfaces vs Data Structures : Comparing Linked Lists and Arrays</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/dynamic-arrays">Dynamic Arrays</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/stacks">Stacks</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/queues">Queues</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/binary-search-trees">Binary Search Trees</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/graphs">Graphs</a></p></li><li><p>Heaps</p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/heaps-part-i">Heaps Part 1 : An Introduction</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/heaps-ii">Heaps Part 2 : How to construct one</a></p></li><li><p><a href="https://bowtiedhamachi.substack.com/p/heaps-part-iii">Heaps Part 3 : Finalizing Run Time</a></p></li></ol></li></ol><p></p><p><strong>Algorithms</strong></p><ol><li><p><a href="https://bowtiedhamachi.substack.com/p/comparing-algorithms">Comparing Algorithms</a></p><p></p></li></ol><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Think Like A Programmer is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Numerical Representations]]></title><description><![CDATA[Hello anon!]]></description><link>https://bowtiedhamachi.substack.com/p/numerical-representations</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/numerical-representations</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sun, 30 Oct 2022 15:31:00 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!pNf0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pNf0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pNf0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pNf0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pNf0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pNf0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pNf0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg" width="1456" height="972" data-attrs="{&quot;src&quot;:&quot;https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com/public/images/1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:972,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:598291,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!pNf0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 424w, https://substackcdn.com/image/fetch/$s_!pNf0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 848w, https://substackcdn.com/image/fetch/$s_!pNf0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!pNf0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fbucketeer-e05bbc84-baa3-437e-9518-adb32be77984.s3.amazonaws.com%2Fpublic%2Fimages%2F1b732f9f-bc8e-473b-bd7d-3b8955a72781_2768x1848.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Hello anon!</p><p>It&#8217;s been a while since I announced the new paid Substack and I&#8217;ve been rewriting and re-organising a lot of the content so that I feel comfortable publishing it as a paid article. </p><p>Today&#8217;s drop marks the first two paid articles in the series and I hope you like it. I&#8217;ve added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way</p><div><hr></div><h4>                                              Keep Reading with a 7 Day Free Trial</h4><p>Subscribe to <strong>Think Like A Programmer </strong>to keep reading this post and get 7 days of free access to the full post archives</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?coupon=cbeff0fc&quot;,&quot;text&quot;:&quot;Get 7 day free trial&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://bowtiedhamachi.substack.com/subscribe?coupon=cbeff0fc"><span>Get 7 day free trial</span></a></p><div><hr></div>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/numerical-representations">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Arrays]]></title><description><![CDATA[Our first article in our data structure series! Look forward to more to come.]]></description><link>https://bowtiedhamachi.substack.com/p/arrays</link><guid isPermaLink="false">https://bowtiedhamachi.substack.com/p/arrays</guid><dc:creator><![CDATA[BowTiedHamachi]]></dc:creator><pubDate>Sun, 30 Oct 2022 15:30:59 GMT</pubDate><enclosure url="https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 424w, https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 848w, https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1272w, https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1456w" sizes="100vw"><img src="https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80" width="424" height="636" data-attrs="{&quot;src&quot;:&quot;https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1500,&quot;width&quot;:1000,&quot;resizeWidth&quot;:424,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;white satellite dish on green grass field during daytime&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="white satellite dish on green grass field during daytime" title="white satellite dish on green grass field during daytime" srcset="https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 424w, https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 848w, https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1272w, https://images.unsplash.com/photo-1619921845646-6216752a036c?ixlib=rb-4.0.3&amp;ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h1>Introduction</h1><p>This is the second paid post in this substack&#8217;s history! We&#8217;ve got a good amount of content lined up, especially for data structures and stay tuned for more good content to come.</p><p>I&#8217;ve added a 7 day free trial that will allow you to get access to the content below which will give you a quick glance at what is on the way</p><div><hr></div><h4>                                              Keep Reading with a 7 Day Free Trial</h4><p></p><p>Subscribe to <strong>Think Like A Programmer </strong>to keep reading this post and get 7 days of free access to the full post archives</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://bowtiedhamachi.substack.com/subscribe?coupon=cbeff0fc&quot;,&quot;text&quot;:&quot;Get 7 day free trial&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://bowtiedhamachi.substack.com/subscribe?coupon=cbeff0fc"><span>Get 7 day free trial</span></a></p><p></p><div><hr></div>
      <p>
          <a href="https://bowtiedhamachi.substack.com/p/arrays">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>