{"id":111,"date":"2022-05-04T10:25:51","date_gmt":"2022-05-04T10:25:51","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/?p=111"},"modified":"2022-05-15T02:11:19","modified_gmt":"2022-05-15T02:11:19","slug":"underneath-the-sycamore-binary-tree","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/2022\/05\/04\/underneath-the-sycamore-binary-tree\/","title":{"rendered":"Underneath the Sycamore Binary Tree"},"content":{"rendered":"<blockquote>\n<div>Two roads diverged in a yellow wood,<\/div>\n<div>And sorry I could not travel both\u2026<\/div>\n<div><\/div>\n<\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-112 alignleft\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/damian-siodlak-KyCzR06ypjI-unsplash-225x300.jpg\" alt=\"\" width=\"225\" height=\"300\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/damian-siodlak-KyCzR06ypjI-unsplash-225x300.jpg 225w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/damian-siodlak-KyCzR06ypjI-unsplash-768x1024.jpg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/damian-siodlak-KyCzR06ypjI-unsplash-1152x1536.jpg 1152w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/damian-siodlak-KyCzR06ypjI-unsplash-1536x2048.jpg 1536w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/damian-siodlak-KyCzR06ypjI-unsplash-scaled.jpg 1920w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/p>\n<div>While \u201c<em>The Road Not Taken<\/em>\u201d may be the most misinterpreted poem in American history, indulge me for a second. Even though these famous words came about some 40 years before the publication of the binary search tree algorithm, Robert Frost may have understood the concept of binary Boolean logic. How a choice made in the present will effect where you end up in the future. \u00a0Choosing the path on the left will take you downstream to a different point relative to the position you have ended up at if you had taken the right path. And no subsequent decisions will ever get you to the exact position of someone who took the latter.<\/div>\n<p>You make choices, or should make choices, based on the expected result that you will manifest due to that choice being made. This all sounds well and good, until you realize that having made a different choice at that point in time could have put you in a more desirable current situation. To add to the complexity, where you want to end up may not be the place you want to be when you get there, compared to other \u201ccould have, would have, should haves.\u201d You see where I\u2019m leading you with this right? The problem is that we are forced to pick a left or a right branch without the ability to see the tree in its entirety.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-115 alignright\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/9207808D-7173-45DA-9055-74AC00BEE2D2-e1651706952737-218x300.png\" alt=\"\" width=\"218\" height=\"300\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/9207808D-7173-45DA-9055-74AC00BEE2D2-e1651706952737-218x300.png 218w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/9207808D-7173-45DA-9055-74AC00BEE2D2-e1651706952737-745x1024.png 745w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/9207808D-7173-45DA-9055-74AC00BEE2D2-e1651706952737-768x1056.png 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/9207808D-7173-45DA-9055-74AC00BEE2D2-e1651706952737-1117x1536.png 1117w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/9207808D-7173-45DA-9055-74AC00BEE2D2-e1651706952737.png 1229w\" sizes=\"auto, (max-width: 218px) 100vw, 218px\" \/><\/p>\n<p>You probably want me to pause so you can say \u201cbut binary search trees choose the path based on whether the current location is more or less than a desired outcome, so it will always get to where it wants to go.\u201d Binary trees catalogue values from left to right in the order given, allowing the tree to be <em>searched<\/em>\u00a0easily for any value already positioned. \u00a0We know that we can <em>find<\/em> any established value in the tree with a single repetitive Boolean operation. It\u2019s not the search algorithm that I\u2019m focused on. It\u2019s the creation algorithm of the tree, and depending on the order of decisions you are given, the tree will always result in a different shape. You will not know what that tree will look like until you have been given all the values, and what order they are given. Change the order of values, and you have a completely different tree. To give you a visualization, play around with this BST creator, and refresh your browser each time. <a href=\"https:\/\/kanaka.github.io\/rbt_cfs\/trees.html\">https:\/\/kanaka.github.io\/rbt_cfs\/trees.html<\/a>.<\/p>\n<p>Life&#8217;s decisions are like creating a binary tree. Your decision will take you on a journey leading to subsequent decisions. However, those subsequent decisions cannot be handled in the same way had you been given that decision one level back. The order in which you are given decisions, and your current position in life all determine how your tree takes shape. Binary trees also show us that we do not meet these decisions in a repetitious, orderly fashion. You may find a sycamore tree outside your house and be presented with the decision of whether to seek shade under it. What you may not realize is that it was once, in fact, one of 500 seeds carried by astronaut Stuart Roosa on the 1971 mission to the Moon aboard the Apollo 14 spacecraft.\u00a0 Had NASA made the choice to keep better chain-of-custody records of where the seeds ended up after the mission, many homeowners like you would not be presented with the decision to enjoy the shade of a sycamore tree right outside their window.<\/p>\n<figure id=\"attachment_123\" aria-describedby=\"caption-attachment-123\" style=\"width: 300px\" class=\"wp-caption alignleft\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-123\" src=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/E3bQnBNWEAA_MfC-300x199.jpeg\" alt=\"\" width=\"300\" height=\"199\" srcset=\"https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/E3bQnBNWEAA_MfC-300x199.jpeg 300w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/E3bQnBNWEAA_MfC-768x508.jpeg 768w, https:\/\/osu-wams-blogs-uploads.s3.amazonaws.com\/blogs.dir\/5448\/files\/2022\/05\/E3bQnBNWEAA_MfC.jpeg 828w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><figcaption id=\"caption-attachment-123\" class=\"wp-caption-text\">Property of Disney+<\/figcaption><\/figure>\n<p>In last week&#8217;s post, I complained about the fact that Loki season two\u00a0 hasn&#8217;t appeared on Disney+ yet. But Doctor Strange In The Multiverse of Madness is premiering this week so please bear with me as I use another Marvel reference. Barring the idea that a &#8220;Nexus Event&#8221; is even possible, we all branch off a set path depending on our decisions in the moment. Even if we think we are always choosing based on the same criteria every time, the order of decisions thrown at us will ultimately change our branch&#8217;s configuration. We are all variants on some level.\u00a0 But don&#8217;t expect Stephen Strange to sort out your life anytime soon.<\/p>\n<p>Had I not chosen to work in class action administration out of law school, or had I chosen to buy that house I almost closed on before I was convinced to move to another state (pre-housing market craziness mind you-I&#8217;m still kicking myself for that), or had I chosen to skip that stomach wrenching Arby&#8217;s sandwich earlier today&#8230;who know&#8217;s where I would have ended up. Would I be in OSU&#8217;s program? Had I not returned to college for a computer engineering degree, would I have realized that our lives follow paths eerily similar to that found in nature, how a tree&#8217;s trunk growth follows the Fibonacci sequence.<\/p>\n<p>Learning computer programming has taught me a lot. More than I thought I would get from staring at lines of code each night. I now see the beauty in mathematical algorithms and, to a certain extent, how my existence in this exact time and space can be traced and explained by a program that I now have the ability to design, if given the right variables.<\/p>\n<p>Robert Frost may have understood the binary tree algorithm more than he realized. In the second stanza, his poem admits that the passing on both paths &#8220;worn them really about the same.&#8221; Meaning that he was, in fact, not on a road less traveled but one equally traveled and of equal consequence. He states that he left the other path for another day, but doubts he will ever return. In other words, you can&#8217;t go back and rearrange the way your tree&#8217;s branches once you&#8217;ve plotted your nodes.\u00a0 Frost later tells &#8220;with a sigh&#8221; that this earlier choice had made all the difference. Frost eludes to the lie we tell ourselves that our choices are the only variables that dictate our fate.\u00a0 We deceive ourselves to believe that we are a creation of our own decisions, and our decisions alone.\u00a0 But he knew better. You also have to consider the order in which these infinite decisions are handed to you, the chaos theory, the missing variables &#8220;chance,&#8221; &#8220;luck,&#8221; and &#8220;opportunity.&#8221;\u00a0 Our lives are unique binary trees, growing amongst each other in a yellow wood.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Two roads diverged in a yellow wood, And sorry I could not travel both\u2026 While \u201cThe Road Not Taken\u201d may be the most misinterpreted poem in American history, indulge me for a second. Even though these famous words came about some 40 years before the publication of the binary search tree algorithm, Robert Frost may &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blogs.oregonstate.edu\/codesandkeys\/2022\/05\/04\/underneath-the-sycamore-binary-tree\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Underneath the Sycamore Binary Tree&#8221;<\/span><\/a><\/p>\n","protected":false},"author":12270,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"link","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-111","post","type-post","status-publish","format-link","hentry","category-capstone","post_format-post-format-link"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/users\/12270"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/comments?post=111"}],"version-history":[{"count":10,"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/posts\/111\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/posts\/111\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/media?parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/categories?post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/codesandkeys\/wp-json\/wp\/v2\/tags?post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}