<?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 Emma H on Medium]]></title>
        <description><![CDATA[Stories by Emma H on Medium]]></description>
        <link>https://medium.com/@emmahughescodes?source=rss-ab5ad5300d16------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*tXX2ks8YJgnwh6QC70syHg.jpeg</url>
            <title>Stories by Emma H on Medium</title>
            <link>https://medium.com/@emmahughescodes?source=rss-ab5ad5300d16------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 21:49:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emmahughescodes/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[Big O Notation]]></title>
            <link>https://medium.com/@emmahughescodes/big-o-notation-5f037e1c0dfa?source=rss-ab5ad5300d16------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f037e1c0dfa</guid>
            <category><![CDATA[optimization-algorithms]]></category>
            <category><![CDATA[computer-programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[technical-interview]]></category>
            <category><![CDATA[computer-science]]></category>
            <dc:creator><![CDATA[Emma H]]></dc:creator>
            <pubDate>Fri, 21 Dec 2018 15:40:08 GMT</pubDate>
            <atom:updated>2018-12-21T15:40:08.128Z</atom:updated>
            <content:encoded><![CDATA[<p>Big O Notation is an important concept in Computer Science and also a popular tech interview question. So what is it? There are a lot of definitions on the web that are quite similar but at its essence, it’s a way to describe how fast an algorithm is! Some definitions will say its about the run-time complexity, or the efficiency/performance of an algorithm, however they’re all reaching the same point… how <em>fast</em> is the algorithm???</p><h3><strong>O(<em>f</em>(n))</strong></h3><p>So let’s start with how we write this <em>notation</em>: Place a capital O in front of the function, f(n). For instance when describing a linear function we write O(n) and pronounce this “O of n”. Where O stands for <em>Order</em> (which in math terms means how fast a function grows) and <em>n</em> is the input size. For example an array with 30 elements has an input size of 30. However, with Big O Notation we always want to think worst-case scenario input size. So not an array of 1000, or one million pieces of data, but a number tending towards infinity!</p><h3><strong>Code → Math equation → Big O Notation</strong></h3><p>So how does this affect you as a developer? Every line of code we write can be considered part of an algorithm (an algorithm is a set of steps completed in order to solve a problem) and algorithms can be expressed using mathematical functions. Mathematical functions can be written with any letters so we use Big O notation as a standard way of expressing that function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*_-6BW-jdAwJ9zXB7" /></figure><p>Let’s look at the familial y=x . It’s a linear function. The input is directly proportional to the output. Well the letters y and x are somewhat arbitrarily chosen, so with Big O Notation we know the function is written with respect to the input (which in our case is <em>n</em>) which grows linearly (so the order of growth is 1) so we write O(n¹) which can be simplified to O(n).</p><p>Also let’s clear up some terminology, a computer programming function is not an algorithm and vice versa. A function is concrete, generally it takes parameters and returns a value. Algorithms can be written inside of a function and are run when the function is called. Additionally a function is a computer science term that came out of the mathematical term, being the machine implementation of the mathematical concept.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wbp9sc0Daucv0Qo6" /></figure><p>The Big-O Complexity chart above is from the classic Big O Notation cheat sheet (<a href="http://bigocheatsheet.com/">http://bigocheatsheet.com/</a>). The x axis is the input size (n) and the y axis is the Operations (or number of steps to complete the algorithm). In efficiency of the algorithm decreases as you move from the green area to the red area.</p><p>So to test out these algorithms I created an array of 3000 elements (quite small if we are being honest) and I filled that array with numbers from 0 to 2999. And I may have done a couple small tweaks to the data so let’s check!</p><p><strong>Example One: </strong>Let’s look at the fastest algorithm O(1) — constant run time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/0*Au9wuh-Jav6sX0wE" /></figure><p>I wrote a function that performs a one step, constant algorithm that checks if the value in the first index of the array ( index[0] ) is null. So this algorithm simply checks the same spot every time this function is called! It is so quick — it knows exactly where and what to check for — wow! :)</p><p>So it’s no surprise that the run time for this algorithm is always 1ms.</p><p><strong>Example Two: </strong>O(n) — Linear run time</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/0*wvMzHgdzFwm3jiVO" /></figure><p>This function takes the same array of 3000 elements and a value chosen by the user as parameters and checks if that value exists in the array. The algorithm is a single for loop that goes through every index of the array until it finds the value it is looking for. This is a linear growth and the time will vary depending at which index the value exists. In this case, I asked the algorithm to check for the value 2000 and it exists! It was found in 3ms. So a bit more time than constant run time O(1) but remember this is a <em>very </em>small dataset of 3000 elements.</p><p><strong>Example Three: </strong>O(n²) quadratic run time</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/0*KXBAc_psispkcp-_" /></figure><p>In this example our function takes the parameter of our array with 3000 elements and the algorithm checks if the array contains duplicate values. This algorithm is a for loop that goes through the entire array and for each value goes through the array again and with another for loop! This nested for loop algorithm can be represented with a quadratic function which in the Big-O Complexity chart is described with “Horrible” efficiency! That’s a Big Oh No(tation)!!! :)</p><p>So to conclude, I did add a duplicate value in the array and this for loop found it in 30ms. That is a significant increase in time compared to the other algorithms, especially given that we are just looking through a small array of 3000 elements.</p><p>Let’s assess how long it would take this algorithm to perform if we increased this array to one million elements. So <em>n </em>= 1,000,000 and we can assume it takes 1ms to check each index in the array. So n² → (1000000)² → 1,000,000,000,000 → which is ~31.7 years!! We would be here for a while…</p><p>So there has to be more efficient algorithms out there, right? Well on the Big O Complexity chart there is the O(logn) function in the green area. Logarithmic functions are extremely efficient because they an algorithm paradigm called <em>Divide and Conquer. </em>This style of algorithm breaks the problem into smaller sub-problems and then combines the solutions to the sub-problems to create the final solution. But I digress…</p><p><strong>Example Four: </strong>A classic logarithmic function is the Binary Search algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*03PXA6c9asGtmbZ7" /><figcaption>Classic computer science analogy tool — the phone book!</figcaption></figure><p>Search algorithms require the dataset be sorted (with regards to the data this could mean alphabetically, numerically, etc). So a phone book is a great set of data because it is sorted alphabetically! In this example I am going to look for my own name, EMMA. With binary search we are cutting the dataset in half each step of the way. So halfway between A and Z is <em>Amazon</em> — just kidding — it’s in the general M and N area. I ask myself is E in the first half or the second half? It’s in the first half so I discard the second half and already I’ve cut down on the data that I have to search through! I cut A — M in half and now I’m at G. Is E in the first half or the second half? It’s in the first half. So discard the second half. Split A — G in half and this is the letter D. E is in the second half so I discard A — D and keep E — G. Now split E — G in half and I have E-F and F-G. I discard F-G and split E-F in half, keeping the E section! I split E in half and I’m in the ‘EM’ section. Perfect, I’ve located EMMA in 6 steps! That is extremely quick. If I had employed the Linear search algorithm I would have had to look through every page starting at A to look for EMMA which would have been roughly 400 pages of data to flip and read!</p><p>So in conclusion, what is Big O Notation? It’s a way to describe how fast an algorithm is! Be careful of how an algorithm you code will behave as the dataset scales up towards infinity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Rwu9uV-ZUPK7vffW" /><figcaption>This technical presentation was created for a baby shower themed event at HackerYou</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f037e1c0dfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I just changed my twitter handle to @emmahughescodes and it scares me a little]]></title>
            <link>https://medium.com/@emmahughescodes/i-just-changed-my-twitter-handle-to-emmahughescodes-and-it-scares-me-a-little-7e9e15474d?source=rss-ab5ad5300d16------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e9e15474d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[toronto]]></category>
            <category><![CDATA[codingbootcamp]]></category>
            <dc:creator><![CDATA[Emma H]]></dc:creator>
            <pubDate>Sun, 04 Nov 2018 20:54:16 GMT</pubDate>
            <atom:updated>2018-11-12T22:30:43.809Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*hGeEMvNDZYG2rY3qwzZ81g.jpeg" /></figure><p>I graduated from Industrial engineering in June 2017 with experience working in tech from some co-op opportunities as a Business Analyst, Data Analyst, and Process Engineer and spent a year after graduation working as a Product Manager at a small but hectic software company. I had completed software development courses in university but never got the hands on experience of coding so I decided to enroll in the part-time HackerYou web development courses. I enjoyed my time so much at HY that I applied for the bootcamp course and here were are on this Sunday afternoon heading into week 3 of 9 and I could not be happier :)</p><p>Throughout my experiences working in tech I never once worked with a female developer. I’ve worked at 6 companies. Two of those companies had a team of ~15 male developers. The only female in sight was a Product Manager and a Data Analyst. I subconsciously accepted that these were the only roles for a female and ended up doing both of those jobs! What I love about HackerYou is the amount of females they are helping to bring into the tech industry. More than half of the class is female identifying and I find this to be refreshing and much needed. I am excited to see what the tech industry in Toronto looks like in five years!</p><p>As I make the transition from Product Manager to Developer I know I will have a solid foundation in the way software is built as team but what I am most excited about is really getting to know the details of how it is built and owning my part. I think there is something special about both roles; for the Product Manager its the amazing responsibility of the ideation of features for the product and best serving the client’s needs. For the developer, you are busy assembling your part and learning what is possible and/or feasible and what is not and relaying this to the Product Manager in order for them to assess the product holistically. I might miss my Product Manager role but I believe it will make me a stronger developer. In honour of my pivot to coding I have changed my twitter handle to @emmahughescodes and it scares me a little. All in all, I’m not ready to say adios to the tech world just yet …</p><p>Namaste,</p><p>Emma</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e9e15474d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>