<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Marc Brathwaite on Medium]]></title>
        <description><![CDATA[Stories by Marc Brathwaite on Medium]]></description>
        <link>https://medium.com/@marcbrathwaite?source=rss-ce2239630e50------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0Qg3MrBJCNbAc6M7BGHs9w.jpeg</url>
            <title>Stories by Marc Brathwaite on Medium</title>
            <link>https://medium.com/@marcbrathwaite?source=rss-ce2239630e50------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 20:21:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@marcbrathwaite/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Implementing the Insertion sort algorithm in JavaScript]]></title>
            <link>https://medium.com/@marcbrathwaite/implementing-the-insertion-sort-algorithm-in-javascript-cccbc11d47b2?source=rss-ce2239630e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/cccbc11d47b2</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Marc Brathwaite]]></dc:creator>
            <pubDate>Sun, 11 Nov 2018 17:15:17 GMT</pubDate>
            <atom:updated>2018-11-11T17:15:17.751Z</atom:updated>
            <content:encoded><![CDATA[<p>Sorting is a fundamental process in programming. There are numerous sorting algorithms which vary in terms of complexity, speed and efficiency. In this post I will take a look at the Insertion Sort algorithm and provide a JavaScript implementation.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgfycat.com%2Fifr%2Fdensebaggyibis&amp;url=https%3A%2F%2Fgfycat.com%2Fdensebaggyibis&amp;image=https%3A%2F%2Fthumbs.gfycat.com%2FDenseBaggyIbis-size_restricted.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=gfycat" width="946" height="514" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ee7e0a7efc86591d8a077d92a1c3a68/href">https://medium.com/media/3ee7e0a7efc86591d8a077d92a1c3a68/href</a></iframe><p>Insertion sort builds up the sorted array one item at a time, by gradually creating a left portion of the array which is always sorted. Compared to more advanced algorithms such as <a href="https://en.wikipedia.org/wiki/Quicksort">Quicksort</a> and <a href="https://en.wikipedia.org/wiki/Merge_sort">Merge sort</a>, it is significantly less efficient when sorting large lists. However, it has a few advantages including:</p><ul><li>High efficiency for nearly sorted lists, as it is able to complete in linear time.</li><li>It is an <strong>online</strong> algorithm i.e. It does well when there is a need for your data to be continuously sorted as new elements are added, as the entire data-set is not required.</li><li>It is an <strong>in-place</strong> algorithm i.e. sorting occurs without any additional data structures.</li></ul><h4>Pseudo-Code</h4><pre>Loop from i = 1 to i = array.length -1<br>  Store i in a variable (index = i)<br>  Loop j = i - 1 to j = 0 as long as array[index] &lt; array[j]<br>    Swap positions of array[index] with array[j]<br>    Decrement index by 1<br>  close-Loop<br>close-Loop</pre><p>The above Pseudo code could be explained in the following steps:</p><ul><li>Start by choosing the second element of the array</li><li>Compare the chosen element to the element before it, if it is smaller, swap the positions of the two elements</li><li>Continue to traverse the left side (sorted portion) of the array , comparing each element to the chosen element and swapping positions if required. If the chosen element is bigger than an element from the sorted portion, stop traversing.</li><li>Repeat until the array is sorted</li></ul><h4>JavaScript Code</h4><pre>//Function to swap indexes in array<br>const swap = (arr, indx1, indx2) =&gt; {<br>[arr[indx1], arr[indx2]] = [arr[indx2], arr[indx1]]<br>};</pre><pre>function insertionSort(arr) {<br>  //If arr size is 1 or less, it is already sorted<br>  if (arr.length &lt;= 1) return arr;</pre><pre>  for (let i = 1; i &lt; arr.length; i++) {<br>    let index = i;<br>    for (let j= i-1; j &gt;= 0 &amp;&amp; arr[index] &lt; arr[j]; j--) {<br>      swap(arr,index,j);<br>      index--;<br>    }<br>  }<br>  return arr;<br>}</pre><h4>Time and Space Complexity</h4><p>The best case time complexity for the Insertion sort algorithm is <strong>O(n)</strong> i.e. linear time. This scenario occurs when the data is nearly sorted, therefore minimal swaps are required. However, the worst and average case time complexities are both <strong>O(n²)</strong> i.e. quadratic time, as the algorithm does poorly with completely unsorted data.</p><p>Space complexity for this algorithm is <strong>O(1) </strong>i.e. constant space, as the space required to perform the sorting remains constant as the size of the data-set increases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cccbc11d47b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The beginning of my web development journey]]></title>
            <link>https://medium.com/@marcbrathwaite/the-beginning-of-my-web-development-journey-105e0e1b3519?source=rss-ce2239630e50------2</link>
            <guid isPermaLink="false">https://medium.com/p/105e0e1b3519</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Marc Brathwaite]]></dc:creator>
            <pubDate>Mon, 05 Nov 2018 02:41:43 GMT</pubDate>
            <atom:updated>2018-11-05T02:41:43.585Z</atom:updated>
            <content:encoded><![CDATA[<p>It is a great time to be a software/web developer in Toronto. Companies such as Microsoft, Google and Shopify have made plans to increase investment in Toronto’s market. Even before the announcements from these tech giants, I came across multiple stories online where people who were in unrelated fields of work, successfully transitioned into developer roles in the tech industry. These stories have inspired me to attempt to do the same, and this blog post (my Hello World!) gives an overview of the path I have taken so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZiAc98VsN-j5MePY" /><figcaption>“top building antenna” by <a href="https://unsplash.com/@samuelzeller?utm_source=medium&amp;utm_medium=referral">Samuel Zeller</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Since my days in undergrad I have always had a strong interest in software development. This was my first exposure to it, and I enjoyed the intellectual challenge it provided. Unfortunately, after graduation, there weren’t many software job opportunities in my home country, Barbados, therefore, my first job after university was at a Telecommunications company, as a Mobile Network Engineer. A part of my role involved making design decisions based on large data-sets of network traffic, as well as providing reports such as subscriber usage to marketing departments and upper level management. I quickly realized an opportunity to make my job easier using software, and I taught myself Perl and Awl programming languages, which I used to manipulate and process the data-sets. I worked at this company for four years until I decided to move to Canada to join my girlfriend.</p><p>After completing my Masters of Engineering, I got a job working at one of the Telecom companies in Toronto. My job was in technical operations, which was very different from the engineering role I had in my previous job. I quickly became disinterested in this role as it was very repetitive and not intellectually challenging. Although I did well professionally (eventually moving up to manager), I always craved more, and found myself constantly reading stories of persons who changed industries, as well as researching software bootcamps and part-time programs. One of the bootcamps I came across that really peaked my interest was HackerYou’s nine week <a href="https://hackeryou.com/courses/bootcamp">Web Development immersive program</a>. I spent a lot of my time reading the glowing reviews all over the internet, but I knew I was not financially ready to make the jump.</p><p>Then, my lucky break came. My company rolled out a voluntary separation program earlier this year. I accepted this offer the same day I received the email notification about the package! I then quickly applied for the summer bootcamp at HackerYou, which I unfortunately was not accepted to. But, I was advised to take their <a href="https://hackeryou.com/courses/web-development">Part-Time Web Development course</a> and then apply for the fall bootcamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iatspGrikks758yy" /><figcaption>“man using silver MacBook while sitting” by <a href="https://unsplash.com/@nesabymakers?utm_source=medium&amp;utm_medium=referral">NESA by Makers</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Attending the part-time program was one of the best decisions I have ever made. It gave me a strong foundation for Front-end Web Development, and at the end I was able to produce 3 websites I am proud of (<a href="https://marcbrathwaite.github.io/HY-PT-FinalProject/">Here is one</a>). During this time, I also took the time to learn Javascript on my own — taking two Udemy courses: <a href="https://www.udemy.com/the-complete-javascript-course/">The Complete JavaScript Course 2018: Build Real Projects!</a> and <a href="https://www.udemy.com/js-algorithms-and-data-structures-masterclass/">JavaScript Algorithms and Data Structures Masterclass</a> . At the end, I was able to create a <a href="https://marcbrathwaite.github.io/JS-Calculator/">calculator</a> using vanilla Javascript .</p><p>I eventually was accepted into the Fall bootcamp, and two weeks in, I am loving the experience so far. It has been challenging, but HackerYou has an encouraging and supportive community. I look forward to the next seven weeks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=105e0e1b3519" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>