<?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 Kehinde Jejelaye on Medium]]></title>
        <description><![CDATA[Stories by Kehinde Jejelaye on Medium]]></description>
        <link>https://medium.com/@kehindejejelaye?source=rss-8d9cdec26336------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FiyqmlSJj1aC7kBNkXC0Zw.jpeg</url>
            <title>Stories by Kehinde Jejelaye on Medium</title>
            <link>https://medium.com/@kehindejejelaye?source=rss-8d9cdec26336------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 22:03:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kehindejejelaye/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: A Simple Guide To A Terrifying Topic]]></title>
            <link>https://medium.com/@kehindejejelaye/big-o-notation-a-simple-guide-to-a-terrifying-topic-ee84cc2284e4?source=rss-8d9cdec26336------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee84cc2284e4</guid>
            <dc:creator><![CDATA[Kehinde Jejelaye]]></dc:creator>
            <pubDate>Tue, 21 Mar 2023 11:43:07 GMT</pubDate>
            <atom:updated>2023-03-21T11:43:07.909Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tGiIYSryLRxv3BQ7" /><figcaption>Photo by <a href="https://unsplash.com/@timswaanphotography?utm_source=medium&amp;utm_medium=referral">Tim Swaan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a beginner in the world of programming, it’s important to understand the concept of Big O notation.</p><p>Simply put, Big O notation is a mathematical representation that helps us understand how efficient an algorithm is. It’s a way of measuring the scalability and performance of code, <em>particularly when the size of the input data grows larger</em>.</p><p>In this article, we will discuss the most common notations used in Big O notation and explain what they mean in plain English.</p><h3>O(1) — Constant Time</h3><p>Constant time means that the algorithm takes the same amount of time to complete, regardless of the size of the input data. In other words, the time required to execute the algorithm is constant.</p><p>An example of this is accessing an element in an array. It doesn’t matter how large the array is, it takes the same amount of time to access an element.</p><pre>// O(1) - Constant Time <br><br>/*<br>** In this example, we are calculating the sum of all the elements ** in an array. As the size of the array grows, the time it takes to ** execute the code increases proportionally.<br>*/<br>int firstElement = array[0];<br>Console.WriteLine(firstElement);</pre><h3>O(n) — Linear Time</h3><p>Linear time means that the time required to execute the algorithm is directly proportional to the size of the input data. As the input data grows larger, the time required to execute the algorithm grows proportionally.</p><p>An example of this is iterating over an array of elements. As the size of the array grows, the time required to iterate over it grows linearly.</p><pre>// O(n) - Linear Time Example<br><br>/* <br>** In this example, we are calculating the sum of all the elements ** in an array. As the size of the array grows, the time it takes to ** execute the code increases proportionally.<br>*/<br>int SumArrayElements(int[] array) {<br>  int sum = 0;<br>  for (int i = 0; i &lt; array.Length; i++) {<br>    sum += array[i];<br>  }<br>  return sum;<br>}</pre><h3>O(n²) — Quadratic Time</h3><p>Quadratic time means that the time required to execute the algorithm is proportional to the square of the size of the input data. As the input data grows larger, the time required to execute the algorithm grows exponentially.</p><p>An example of this is a nested loop that iterates over an array of elements. As the size of the array grows, the time required to iterate over it grows exponentially.</p><pre>// O(n^2) - Quadratic Time<br><br>/* <br>** In this example, we are printing all possible pairs of elements ** in an array. As the size of the array grows, the time it takes to ** execute the code increases exponentially.<br>*/<br><br>void PrintPairs(int[] array) {<br>  for (int i = 0; i &lt; array.Length; i++) {<br>    for (int j = 0; j &lt; array.Length; j++) {<br>      Console.WriteLine(array[i] + &quot; &quot; + array[j]);<br>    }<br>  }<br>}</pre><h3>O(log n) — Logarithmic Time</h3><p>Logarithmic time means that the time required to execute the algorithm grows at a logarithmic rate as the size of the input data grows. This means that the algorithm becomes faster as the input data grows larger.</p><p>An example of this is binary search, where we divide the input data in half repeatedly until we find the value we’re looking for.</p><pre>// O(log n) - Logarithmic Time <br>/*<br>** In this example, we are searching for a target value in a sorted ** array using binary search. As the size of the array grows, the  ** time it takes to execute the code increases logarithmically.<br>*/<br>public void BinarySearchIterative(int[] arr, int num) {<br>  int i = 0; <br>  int j = arr.Length - 1;<br><br>  while (i &lt;= j) { <br>    int midpoint = (i + j)/2; <br>    if (num == arr[midpoint]) {<br>      Console.WriteLine($&quot;The number {num} exists at index {midpoint}&quot;);<br>      break;<br>    } <br>    else if (arr[midpoint] &gt; num) {<br>      j = midpoint - 1;<br>    } <br>    else {<br>      i = midpoint + 1;<br>    }<br>  }<br>}</pre><h3>O(n log n) — Logarithmic Time within a Linear Time</h3><p>This notation describes an algorithm that has both logarithmic time and linear time components.</p><p>An example of this is merge sort (we will discuss this much later), where we divide the input data into smaller arrays, sort those arrays using logarithmic time, and then merge them back together using linear time.</p><p>It’s important to note that Big O notation is not about measuring the exact time an algorithm takes to execute. Instead, it’s a way of measuring the scalability of the algorithm. It helps us determine how much more time an algorithm will take when the input data grows larger.</p><p>In conclusion, understanding Big O notation is an essential skill for any developer, whether they are a beginner or an experienced programmer.</p><p>It helps us write more efficient and scalable code and avoid performance issues as our applications grow in size and complexity. By knowing these common notations and what they represent, you can start to optimize your code and create more performant applications.</p><p>That is all for now.</p><p>Till next time, cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee84cc2284e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Binary Search using Recursion.]]></title>
            <link>https://medium.com/@kehindejejelaye/mastering-binary-search-using-recursion-903e5d5de4b7?source=rss-8d9cdec26336------2</link>
            <guid isPermaLink="false">https://medium.com/p/903e5d5de4b7</guid>
            <dc:creator><![CDATA[Kehinde Jejelaye]]></dc:creator>
            <pubDate>Thu, 09 Mar 2023 11:40:09 GMT</pubDate>
            <atom:updated>2023-03-09T11:40:09.786Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iBUdvNXP3QuBHKX4" /><figcaption>Photo by <a href="https://unsplash.com/@tamanna_rumee?utm_source=medium&amp;utm_medium=referral">Tamanna Rumee</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>In a minute, you are going to see how to perform the binary search algorithm using recursion but, before we do that, let us touch on recursion — what it is, and how it works on a fundamental level.</p><p>Ready? Then let’s go.</p><h3>What is Recursion?</h3><p>Broken to pieces, recursion is a technique where a function calls itself to solve a problem. It is useful for solving problems that can be broken down into smaller, similar sub-problems.</p><p>Here’s a simple C# code example that demonstrates recursion:</p><pre>// This function calculates the factorial of a given number using recursion.<br>public int Factorial(int n)<br>{<br>    if (n == 0) // Base case: if n is 0, the factorial is 1<br>    {<br>        return 1;<br>    }<br>    else // Recursive case: if n is not 0, the factorial is n times the factorial of n-1<br>    {<br>        return n * Factorial(n - 1);<br>        // This line is the recursive call to the function itself.<br>        // It calculates the factorial of n-1 and multiplies it by n.<br>        // The recursion will continue until the base case is reached.<br>    }<br>}</pre><p>Here’s a brief explanation of what’s going on above:</p><p>The factorial function calculates the factorial of a given number n using recursion. The factorial of a number is the product of all positive integers up to that number. For example, the factorial of 5 is 5 x 4 x 3 x 2 x 1 = 120.</p><p>In this code, the function has two cases: the base case and the recursive case.</p><p>The base case is the simplest case where we know the answer without calling the function again. In this case, when n is 0, we return 1 because the factorial of 0 is 1 (this was decided long ago).</p><p>The recursive case is where we call the function again with a smaller input until we reach the base case. In this case, we calculate the factorial of n by multiplying it with the factorial of n-1.</p><p>The function keeps calling itself with smaller values of n until n becomes 0, at which point the base case is reached and the recursion stops.</p><p>Note that recursive functions can be less efficient than non-recursive ones due to the overhead of function calls and stack memory usage.</p><p>However, recursion can sometimes make the code simpler and more elegant, especially for problems that lend themselves well to the technique.</p><p>Here’s the non-recursive function that can help you calculate the factorial of a number (I’ve added comments for easy understanding):</p><pre>// This function calculates the factorial of a given number using iteration.<br>public int Factorial(int n)<br>{<br>    int result = 1; // Initialize the result to 1.<br>    for (int i = 2; i &lt;= n; i++) // Start a loop from i = 2 to i = n.<br>    {<br>        result *= i; // Multiply the result by i for each iteration of the loop.<br>    }<br>    return result; // Return the final result.<br>}</pre><p>Now, that you’ve seen what recursion is and have, hopefully, understood it in simple terms, it’s time for you to see how to solve the binary search problem using it.</p><p>Ready?</p><p>Let’s move.</p><h3>Binary Search — A Simple Overview</h3><p>Binary search is a search algorithm used to find the position of a target value within a sorted array or list.</p><p>It works by repeatedly dividing the search interval in half and checking whether the target value is in the lower or upper half.</p><p>This process is repeated until the target value is found or the search interval becomes empty (Please note that, although we’ll use an array in our example, the search interval refers to anything you want to search through).</p><p>To perform a binary search, we start with the middle element of the array (or list), which divides the array into two halves. We then compare the target value with the middle element.</p><p>If they are equal, we return the index of the middle element. If the target value is greater than the middle element, we search the right half of the array. Otherwise, we search the left half of the array.</p><p>We repeat the above process with the selected half of the array (or list) until we find the target value or the search interval becomes empty.</p><p>Now that you know what the binary search is, it’s time for you to see it in action.</p><pre><strong>Please Note:</strong><br>The code you are about to see assumes that the array it receives is sorted. <br>However, you must always perform checks outside of the function <br>(or even a simple visual inspection, if you can) to ensure that the data <br>you are given is sorted.</pre><pre>// This function performs binary search recursively on a sorted array.<br>// It takes in the array to search, the key to find, and the left and right indices of the search range.<br>public static int binary_recursive(int[] arr, int key, int leftIndex, int rightIndex) <br>{<br>    // If the left index is greater than the right index, the search range is empty and the key is not found.<br>    if (leftIndex &gt; rightIndex) <br>        return -1; <br>    else {<br>        // Calculate the midpoint of the search range.<br>        int midPoint = (leftIndex + rightIndex) / 2;<br>        <br>        // If the key is found at the midpoint, return the index of the midpoint.<br>        if (key == arr[midPoint]) <br>            return midPoint;<br>        // If the key is less than the midpoint, search the left half of the array recursively.<br>        else if (key &lt; arr[midPoint])<br>            return binary_recursive(arr, key, leftIndex, midPoint - 1);<br>        // If the key is greater than the midpoint, search the right half of the array recursively.<br>        else if (key &gt; arr[midPoint])<br>            return binary_recursive(arr, key, midPoint + 1, rightIndex);<br>    }<br>    <br>    // If the key is not found, return -1.<br>    return -1; <br>}</pre><p>Here is an explanation of the code above.</p><p>The function is named binary_recursive and takes in an array arr, a key to search for key, and the left and right indices of the search range leftIndex and rightIndex.</p><p>The function first checks if the search range is empty by comparing leftIndex and rightIndex. If leftIndex is greater than rightIndex, the function returns -1 to indicate that the key is not found.</p><p>If the search range is not empty, the function calculates the midpoint of the search range and checks if the key is equal to the element at the midpoint. If so, it returns the index of the midpoint.</p><p>If the key is less than the element at the midpoint, the function recursively calls itself with the left half of the search range.</p><p>If the key is greater than the element at the midpoint, the function recursively calls itself with the right half of the search range.</p><p>The function continues to recursively search the left or right half of the search range until the key is found or the search range is empty.</p><p>If the key is not found, the function returns -1.</p><p>There you go.</p><p>Till next time.</p><p>Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=903e5d5de4b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Binary Search: A Simple Guide]]></title>
            <link>https://medium.com/@kehindejejelaye/mastering-binary-search-a-simple-guide-357f30ca4090?source=rss-8d9cdec26336------2</link>
            <guid isPermaLink="false">https://medium.com/p/357f30ca4090</guid>
            <dc:creator><![CDATA[Kehinde Jejelaye]]></dc:creator>
            <pubDate>Sun, 05 Mar 2023 17:49:40 GMT</pubDate>
            <atom:updated>2023-03-05T18:30:43.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A4YPxNJcf1ZlZkR2" /><figcaption>Photo by <a href="https://unsplash.com/@enginakyurt?utm_source=medium&amp;utm_medium=referral">engin akyurt</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Two of the most performed operations in the world of Computer Science are searching and sorting. It follows then that understanding how to search for data and how to sort data is crucial.</p><p>In my last post you saw and understood the <a href="https://medium.com/@kehindejejelaye/scared-of-algorithms-start-here-12bf0a4b4c2"><strong>Linear Search Algorithm</strong></a>. And today, you’ll see the <strong>Binary Search Algorithm</strong>. You’ll see what it is, how it can be used and how you can implement it.</p><p>Are you ready?</p><p>Did you say yes?</p><p>Good. Let’s go.</p><p>Imagine picking a number between 1 and 100, let’s say 79 for fun. Now your partner must guess the number you picked with minimal hints from you in the form of the words <em>low</em> or <em>high</em>. (Did I forget to mention that you’re in a competition and a mouthwatering prize is at stake?)</p><p>This means that whenever your partner “guesses”, you say low or high to help your partner arrive at the number you picked.</p><p>How would you advise your partner to go about “finding” the number you picked? Should they go sequentially (i.e. from 1 to 2 to 7 etc)? Or is there a method that can help your partner move quickly so that you can win the grand prize in 60 seconds?</p><p>What did you come up with?</p><p>Nothing? Well, let me show you a simple way through which you can help your partner arrive at the number you picked.</p><p>You ready? Then let’s go.</p><p>There are several ways you can do this:</p><ul><li>You can make random guesses until your minute is up.</li><li>You can go sequentially, from bottom to top or from top to bottom.</li><li>You can seek to find a sweet spot that can help you eliminate numbers that are not close to the number that your partner has chosen.</li></ul><p>Let’s go with the third option. And we’ll pick the number at the middle to help us decide which “direction” your partner should focus on as they try to find the number you’ve picked.</p><p>Before moving on, you should know that you can’t use this method if the numbers are not in order. The numbers must be sorted for you to use this method.</p><p>Alright, let’s move on.</p><p>Remember, your partner picked 79, and the range is from 1 to 100.</p><p>What if you started by picking 50? Well, you can know which half to focus on if your partner said low or high.</p><p>Now, since 79 is not equal to 50 and 79 is higher than 50, we know that the number your partner chose is between 51 and 100. So we can safely discard the first 50 numbers (i.e. the first half).</p><p>What number lies perfectly between 51 and 100? I owe you a 10 inch pizza if you said 75.</p><p>Is 75 lower or higher than 79? It is definitely lower, so you have to move up and focus on the numbers between 76 and 100.</p><p>What number is between 76 and 100? Don’t get tired yet, we’ll soon be done.</p><p>Well, it is 88. Is 79 equal to 88? No! Is 79 greater than 88? No, it is less than 88. So we shrink our numbers of interest to numbers between 76 and 87.</p><p>The number that best reflects the midpoint of 76 to 87 is 81. And we go through the cycle again.</p><p>Is 81 greater than, less than or equal to 79? It is greater than 79 so we shrink our numbers of interest and discard 81 to 87. Our numbers of interest now lie between 76 and 80.</p><p>Again, we find their midpoint (i.e. the number in the middle). And their midpoint is 78.</p><p>Again, we ask: Is 79 greater than, less than or equal to 78? Well, 79 is greater than 78 so we adjust our numbers of interest and discard the numbers from 78 to 76.</p><p>At this point, we are left with 79 and 80. And we’ll still perform the same check — find a midpoint, check if the midpoint is equal to the number you selected and adjust your range of interest.</p><p>We aren’t done but I’ll leave you to finish up by yourself since you’ve got the logic.</p><p>The example is quite tedious but it shows the inner workings of the search method you’re about to see.</p><p>Let’s see how this is implemented in the code.</p><p>It is important to mention that binary search can be executed using either recursion or iteration.</p><p>Let’s see binary search using iteration first.</p><pre>public void BinarySearchIterative(int[] arr, int num) {<br>  // This method takes an integer array &#39;arr&#39; and an integer &#39;num&#39; as inputs<br>  // please remember to provide a sorted array.<br><br>  int i = 0; // Initialize the variable i to 0, representing the first index in the array<br>  int j = arr.Length - 1 // Initialize the variable j to the last index in the array<br>  <br>  while (i &lt;= j) { // While the first index is less than or equal to the last index<br>    int midpoint = (i + j)/2; // Calculate the midpoint between the first and last index<br>    <br>    // Check if the value at the midpoint index equals the search key<br>    if (num == arr[midpoint]) {<br>      Console.WriteLine($&quot;The number {num} exists at index {midpoint}&quot;);<br>      break;<br>    } <br>    // If the value at the midpoint index is greater than the search key, move the last index to the left of the midpoint<br>    else if (num &lt; arr[midpoint]) {<br>      j = midpoint - 1;<br>    } <br>    // If the value at the midpoint index is less than the search key, move the first index to the right of the midpoint<br>    else {<br>      i = midpoint + 1;<br>    }<br>  }<br>}</pre><p>And that is how it’s done.<br>This was long but it was necessary to appreciate how the algorithm works.</p><p>I hope this helps.</p><p>Till next time, cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=357f30ca4090" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scared of Algorithms? Start here…]]></title>
            <link>https://medium.com/@kehindejejelaye/scared-of-algorithms-start-here-12bf0a4b4c2?source=rss-8d9cdec26336------2</link>
            <guid isPermaLink="false">https://medium.com/p/12bf0a4b4c2</guid>
            <dc:creator><![CDATA[Kehinde Jejelaye]]></dc:creator>
            <pubDate>Thu, 02 Mar 2023 18:23:45 GMT</pubDate>
            <atom:updated>2023-03-02T18:27:11.873Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Boy counting on Abacus" src="https://cdn-images-1.medium.com/max/1024/0*fNnIdZ49TOJ1WrmW" /><figcaption>Photo by <a href="https://unsplash.com/@luism_arias?utm_source=medium&amp;utm_medium=referral">luis arias</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Over the past 6 weeks, I’ve been in an environment where algorithms are frequently discussed and attempted. This means that it is impossible to function well without understanding what algorithms are and how to use them. It also means that you must be familiar with data structures because algorithms are used to manipulate them.</p><p>The fact is that these are two of the most challenging topics in Computer Science and, to make it even more annoying, they are painfully abstract. To top it off, finding the right study material is plentiful in some languages while it is scarce in other languages. And, while some people are uniquely capable of understanding these subjects even when they are written in other languages, not everyone can study/practice algorithms in C and convert them to C#.</p><p>And that is the issue I’m trying to fix. I found that I was unable to get a boatload of free quality materials for algorithms and data structures in C# and the once I found were unnecessarily filled with confusing buzzwords and mathematical formulas that can make you abort your desire to study algorithms.</p><p>What I aim to achieve here is to explain my understanding of common algorithms and data structures in C# in the hope that it will reduce your confusion and aid your software development journey.</p><p>Now that you’ve understood my motive, here’s the simplest algorithm you’ll ever need to implement.</p><p>Well, before I show you the algorithm I’m talking about, please understand that knowing this algorithm is crucial to journey because:</p><p>- It shows you that some things are ridiculously simple and</p><p>- It equips you with the confidence to meet tougher ones as you journey forward</p><p>Are you ready? You sure?</p><p>Here we go.</p><p><strong>THE LINEAR SEARCH ALGORITHM</strong></p><p>At its core, an algorithm is simply a set of steps taken to solve a particular problem. That’s it.</p><p>The linear search algorithm basically searches for things in straight line manner.</p><p>Imagine a queue of ten people about to enter a bus. Now before they enter the bus, the bus operator has to verify that every person that wants to board the bus already has a ticket.</p><p>If you don’t have a ticket, you’ll be politely asked to step aside so that you don’t delay the next person.</p><p>The manner in which the bus operator goes about checking the tickets is in a straight line format, i.e <em>linear or sequential</em>.</p><p>Let’s break down the steps involved.</p><p>i) Prospective passengers form a line</p><p>ii) The bus operator starts at the beginning of the line</p><p>iii) The bus operator checks to see if prospective passengers have a ticket</p><p>iv) If they have a ticket, the bus operator permits them to enter the bus.</p><p>v) If they don’t, the bus operator prevents them from entering the bus and asks them to leave the queue.</p><p>vi) The bus operator keeps doing this until no prospective passenger is left on the queue</p><p>In the example above, you’ll see that the bus operator did not do things anyhow, he started from one end of the line and progressed until the line was empty.</p><p>That is what it means to perform a “<strong>linear search</strong>”. The word “<strong>algorithm</strong>” at the end makes it appear difficult but that is truly not the case.</p><p>Think I’m lying?</p><p>Really? Ouch? That hurts.</p><p>Anyway, let’s see how we can write a program to find the position of the person in that line of prospective passengers whose name is “Ann” (assuming there’s only person among the passengers with that name).</p><p>Well, the first thing to do is to understand how a sequence of things are stored — in C# they are stored using arrays.</p><p>The next thing is to know how to move (iterate) over these arrays to search for the things we want.</p><p>And these can be done using loops (whether for loops or while loops).</p><p>You also need to know the item you’re looking for. In our case, it is the name “Ann”.</p><p>So, we’ll start by:</p><p>- creating a function that takes two parameters, the array and the value of the item we want to find in the array.</p><p>- Inside the function, we’ll iterate over the array we’ve received using a for loop</p><p>- We’ll check to see if the item at each position is the name “Ann”</p><p>- If it is, we’ll return the position (index) of the item</p><p>- If the loop is completed and we cannot find the item, we’ll return -1.</p><p>- That’s it.</p><p>Now let’s get to it.</p><pre>public static int LinearSearch(string[] A, string key) <br>{<br>  for (int i = 0; i &lt; A.Length; i++) <br>  {<br>    if (A[i] == key) <br>    { // if it finds the key among the array<br>      Console.WriteLine($&quot;{key} appears at index {i}&quot;);<br>      return i;<br>    }<br>  } <br>  <br>  // if it goes through all the elements in the array finds nothing<br>  return -1;<br>}</pre><p>Here you see a method (function inside a class) named <strong>LinearSearch </strong>that takes two parameters — the array you want iterate over (A) and the value you want to find (key).</p><p>Next, you see a for-loop that starts at the first item all through the last item and checks to see if any item in the array is the same as the key using the if condition.</p><p>If the item is present, it writes a statement to console and returns the index of the item in the array.</p><p>If the item is absent, it returns -1.</p><p>Here’s the full program:</p><pre> public class Program<br> {<br>  public static void Main(string[] args)<br>  {<br>   String[] passengerNames = {&quot;Joshua&quot;, &quot;Ahmed&quot;, &quot;Ann&quot;, &quot;Izuchukwu&quot;, &quot;Emmanuel&quot;, &quot;Muktar&quot;, &quot;Ibrahim&quot;, &quot;Victory&quot;, &quot;Hadiza&quot;};<br>   int passengerPosition = LinearSearch(passengerNames, &quot;Ann&quot;);<br>   Console.WriteLine(passengerPosition);<br>  }<br>  <br>  public static int LinearSearch(string[] A, string key) <br>  {<br>    for (int i = 0; i &lt; A.Length; i++) {<br>      if (A[i] == key) { // if it finds the key among the array<br>        Console.WriteLine($&quot;{key} appears at index {i}&quot;);<br>        return i;<br>      }<br>    } <br>    <br>    // if it goes through all the elements in the array finds nothing<br>    return -1;<br>  }<br> }</pre><p>And with that, you’ve written and understood the linear search algorithm.</p><p>Hope you can see how simple it is.</p><p>Till next time.</p><p>Cheers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12bf0a4b4c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My New Journey]]></title>
            <link>https://medium.com/@kehindejejelaye/my-new-journey-3ba4f672539?source=rss-8d9cdec26336------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ba4f672539</guid>
            <category><![CDATA[journey]]></category>
            <dc:creator><![CDATA[Kehinde Jejelaye]]></dc:creator>
            <pubDate>Mon, 16 Aug 2021 16:32:10 GMT</pubDate>
            <atom:updated>2021-08-16T16:33:35.723Z</atom:updated>
            <content:encoded><![CDATA[<p>A few things matter when you are about starting a journey.</p><p>And of all the things you might probably consider, none is more important than knowing the destination you plan to arrive at.</p><p>And this is because the destination dictates the route to pass, the time to spend and the degree of challenges that will face you on your journey.</p><p>In other words, your destination determines the process you will have to endure before arriving at it.</p><p>Having said that, merely knowing your destination isn&#39;t enough.</p><p>You must have a means of knowing that you are on the right track and and that you are actually closer to your destination than when you first started.</p><p>There is no better way to do this than to use progress marking milestones.</p><p>That&#39;s because milestones are stones set up beside the road to mark the distance to a particular place or destination.</p><p>This implies that a milestone can help you judge how far you have progressed on a journey and how far is still left to go.</p><p>And this part is of utmost importance in helping you reach your destination.</p><p>To show you how to apply it, I recently decided (after flirting with the idea for over two years) that I would be part of the upcoming <a href="https://internship.zuri.team/">Zuri Internship</a>.</p><p>My ultimate goal (read destination) is to become a proficient backend developer.</p><p>However, that cannot happen without having markers by which to judge my progress and how well I understand what I&#39;m learning.</p><p>As a result, I&#39;ve decided on the following goals for the period of my internship.</p><p>Here they are.</p><p>1. To gain working knowledge of application of backend development knowledge to help companies achieve their objective.</p><p>2. To understand the context of value that backend developers bring to a team and I equip myself accordingly so that I am adequately prepared whenever opportunities present themselves.</p><p>3. To home the ability to connect with people and build repertoire across team members.</p><p>4. To build healthy relationships with people who can serve as advisers or mentors for my ongoing career.</p><p>Those are my goals for the internship.</p><p>Anyway, if you are interested in joining the Zuri Internship, it might benefit you to know that they offer internship for Frontend development, UI/UX Design, Backend development and Mobile development.</p><p>And since it&#39;s a bad idea to start an internship unprepared, here are few resources to get started:</p><p>A. Design with <a href="https://youtu.be/c9Wg6Cb_YlU">Figma</a></p><p>B. Master the basics of <a href="https://youtu.be/SWYqp7iY_Tc">GIT</a></p><p>C. Get started with <a href="https://youtu.be/UB1O30fR-EE">HTML</a> here</p><p>D. Understand the basics of <a href="https://youtu.be/w-7RQ46RgxU">Node.js</a></p><p>Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ba4f672539" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>