<?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 Iyanu Adelekan on Medium]]></title>
        <description><![CDATA[Stories by Iyanu Adelekan on Medium]]></description>
        <link>https://medium.com/@iyanuadelekan?source=rss-30bb3de4c373------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*v_wDgUX9dohsIONBsVASQQ.jpeg</url>
            <title>Stories by Iyanu Adelekan on Medium</title>
            <link>https://medium.com/@iyanuadelekan?source=rss-30bb3de4c373------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 02:39:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iyanuadelekan/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[Handling Observable Streams with RxJS Observables, Subscribers and Operators]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/better-programming/handling-observable-streams-with-rxjs-observables-subscribers-and-operators-6111b71a9925?source=rss-30bb3de4c373------2"><img src="https://cdn-images-1.medium.com/max/2600/1*a7dJlq9pkW7SARiRraj-7A.jpeg" width="6000"></a></p><p class="medium-feed-snippet">An overview of RxJS</p><p class="medium-feed-link"><a href="https://medium.com/better-programming/handling-observable-streams-with-rxjs-observables-subscribers-and-operators-6111b71a9925?source=rss-30bb3de4c373------2">Continue reading on Better Programming »</a></p></div>]]></description>
            <link>https://medium.com/better-programming/handling-observable-streams-with-rxjs-observables-subscribers-and-operators-6111b71a9925?source=rss-30bb3de4c373------2</link>
            <guid isPermaLink="false">https://medium.com/p/6111b71a9925</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[rxjs]]></category>
            <category><![CDATA[reactivex]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Iyanu Adelekan]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 13:43:07 GMT</pubDate>
            <atom:updated>2019-09-24T20:33:37.917Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Algorithms Deconstructed: Loop Invariants and Incremental Algorithms]]></title>
            <link>https://medium.com/@iyanuadelekan/algorithms-deconstructed-loop-invariants-and-incremental-algorithms-9ffa6f5a716d?source=rss-30bb3de4c373------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ffa6f5a716d</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[reading]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Iyanu Adelekan]]></dc:creator>
            <pubDate>Mon, 30 Jan 2017 13:21:32 GMT</pubDate>
            <atom:updated>2020-07-10T22:55:44.213Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1i7T1rH4gYprGooMMbNa8w.jpeg" /></figure><p>Like many things in existence, algorithms have their various types — each as important as the next in its field of application.</p><p>Regardless the fact that I’ll be touching on only one type of Algorithm in this post, its imperative to know a number of the other types that exist.</p><p>Below is a non exhaustive list of some categories of algorithm, many of which will be covered in subsequent posts.</p><p><strong>Types of Algorithm</strong></p><ol><li>Incremental algorithms</li><li>Simple recursive algorithms</li><li>BackTracking algorithms</li><li>Randomized algorithms</li><li>Divide and conquer algorithms</li><li>Brute force algorithms</li><li>Dynamic programming algorithms</li><li>Greedy algorithms</li></ol><p>Without further ado, let’s get on with the algorithms to be covered.</p><h3>Incremental Algorithms</h3><p>An incremental algorithm simply put is an algorithm that finds a sequence of solutions that build incrementally, and constantly adapts to changes in inputs. These types of algorithms are known for their uncanny ability to adapt to changes in inputs without the need for constant re-computations.</p><p>Ideal scenario for utilization of incremental algorithms:</p><ol><li>There exists a large volume of data e.g a large database or a significantly large graph</li><li>The data that exists over time is subject to a series of relatively small changes</li><li>The data is to be processed in a useful manner</li><li>It’s important for data to be updated in realtime regardless its volume</li></ol><p>Incremental algorithms solve the problem of having to recompute a set of data after every small change in the data set regardless of how minute it is. This is done by processing the change and sending it (the change only) across a network. Video compression is based on this principle.</p><p>Some languages are readily suited for incremental algorithms. A class of these languages suited is that of which support <em>functional reactive programming</em>.</p><p>One thing to note is there is no known solution for incremental algorithms across all domains. In the spatial dimension, relational algebra is relatively incremental whereas functional reactive programming has little use in this dimension.</p><p>An example of an algorithm that takes an incremental approach to the generation of a solution to a problem is <em>insertion sort</em>.</p><blockquote>One thing to note is there is no known solution for incremental algorithms across all domains.</blockquote><h4>Insertion sort</h4><p>The insertion sort algorithm solves the sorting problem. The sorting problem poses the question of how to sort a given set N consisting of numeric data x1, x2, x3, …, xi in an order of which is explicitly defined.</p><p>Therefore given:</p><p>N = { x1, x2, x3, …, xi | x1, .., xi 𝜖 <strong>R</strong> }</p><p>The elements of the set given above are in no specifically defined order. Insertion sort solves this by operating on the set of numbers N and generating a permutation of this set according to an order rule.</p><p>To explain this further lets define two criteria to be followed:</p><ol><li>The sorting operation of insertion sort is represented by a function 𝑓(𝓝)</li><li>Our sorting operation strictly generates a permutation of the set 𝓝 in which all consecutive elements are in ascending order.</li></ol><p>Following the two criteria given above, we can define our insertion sort procedure as follows:</p><p>𝑓(𝓝) = { n1, n2, n3, …, ni | n1 &lt; n2 &lt; … &lt; ni and n1, …, ni 𝜖 𝓝 }</p><p>Example:</p><p>given a set 𝑺 of numeric data with elements belonging to the field of real numbers <strong>R:</strong></p><p>𝑺 = { 46, 2, 10, 5, 26, 13, 1 , 4, 52 }</p><p>Our insertion sort function 𝑓(𝓝) simply generates a re-arrangement of the data in accordance with criterium 2 (in ascending order).</p><p>Thus:</p><p>where 𝓝 = 𝑺</p><p>𝑓(𝓝) = { 1, 2, 4, 5, 10, 13, 26, 46, 52 }</p><p>The above stated is not only true for insertion sort. It can be said to be true for all algorithms that solve the sorting problem. Regardless the fact that all sorting algorithms produce the same end result, their implementations and sorting processes vary significantly. Below is how insertion sort specifically works.</p><h4>How insertion sort works</h4><p>The sorting process of insertion sort is similar to the way by which a set of cards in hand is sorted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*LU5CP4IF-rsLPMbymnFydQ.jpeg" /><figcaption>An unsorted set of cards</figcaption></figure><p>The process itself is in four phases:</p><ol><li>Select a card</li><li>Compare that card with other cards preceding it</li><li>Place the selected card in an appropriate position</li><li>Move to the next card</li></ol><p>Using the above set of cards as an example:</p><ol><li>Select the six of spades</li><li>Compare with the card preceding it (in this case the queen of spades)</li><li>Move the six of spades to the position of the queen of spades and vice versa</li><li>Move to the next card (five of spades) because there are no more preceding cards</li></ol><p>The algorithm is simple yet relatively effective (considering the small size of the of the amount of cards being sorted).</p><p>I implemented the insertion sort algorithm below for further understanding.</p><p>The implementation of the insertion sort algorithm in C++ is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fFoUu0yeYsVwzyYhxghfdw.jpeg" /><figcaption>Implementation of insertion sort in C++</figcaption></figure><p>The implementation of the insertion sort algorithm in Rust is shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B4VtBbdMtrsJ7h0agakiZQ.jpeg" /><figcaption>Implementation of insertion sort in Rust</figcaption></figure><p>Both implementations of the insertion sort function 𝑓(𝓝) previously described take an unsorted array of data — in this case an unsorted array exclusively containing integer values and not catering for the whole field of real numbers — and return an array of of the integers previously contained put in ascending order.</p><p>In both programs above the respective insertion sort functions are called in the main() functions as follows:</p><ol><li>insertionSort(set)</li><li>insertion_sort(set)</li></ol><p>The arrays of unsorted data are then sorted and an array of sorted data is returned.</p><h3>Loop Invariants</h3><p>We previously defined a set 𝑺 such that:</p><p>𝑺 = { 46, 2, 10, 5, 26, 13, 1 , 4, 52 }</p><p>In order to sort the above set of data in ascending order, as shown via our implementations in C++ and Rust, we employ a variable i to keep track of the selected value to be placed in its appropriate sorting position. As i increases through the looping mechanism (in the for loop) a few things can be observed.</p><ol><li>At any position of i in 𝑺: 𝑺[0..i-1] is in sorted order.</li><li>At any position of i in 𝑺: 𝑺[i+1..n] — where n is the position of the final element in the set — is unsorted.</li><li>The elements in 𝑺[i+1..n] are the elements that were originally in 𝑺[i+1..n] before sorting.</li></ol><p>Loop invariants are used to verify the correctness of an algorithm. To verify the correctness of an algorithm with loop invariants we must show that three things are invariably true:</p><ol><li>Initialization: The loop invariant is true before the first iteration of the loop.</li><li>Maintenance: If the loop invariant is true prior to an iteration of the loop, it is consistently true prior to the next iteration.</li><li>Termination: The loop must terminate and it must give us a useful property to show the algorithm is correct.</li></ol><blockquote>To verify the correctness of an algorithm with loop invariants we must show that initialization, maintenance and termination are invariably true.</blockquote><h4>Testing the correctness of insertion sort with loop invariants</h4><p><strong>Initialization</strong>: We start by showing the loop invariant is true before the first iteration of the loop. Prior to the first iteration, i = 1. The set 𝑺[0..i-1] contains only one value as a result of the position of i. As a result of the presence of only one value in this set, we can say that it is trivially sorted. Hence the loop invariant is true.</p><p><strong>Maintenance</strong>: In the next iteration of the loop, i = 2. The set 𝑺[0..i-1] at this point contains 2 values which are the values at 𝑺[0] and 𝑺[1].</p><p>Thus: 𝑺[0..i-1] = { 46, 2 }</p><p>At this stage, 2 is the selected value to be compared with prior set elements. 46 is found to be greater than 2 and thus their positions are swapped.</p><p>As such: 𝑺[0..i-1] = { 2, 46 }</p><p>As a result of this swapping operation, the set of data 𝑺[0..i-1] is sorted before the loop’s next operation. Therefore, the loop invariant is maintained across loop iterations.</p><p>We can further test for maintenance in the while loop within the for loop if we’d like.</p><p><strong>Termination</strong>: The algorithm in this case terminates. Next we need to verify that the algorithm terminates with a valid result. The algorithm terminates with the correct result if at its end, the elements, 𝑺[0..n] — where n is the position of the last element — are in sorted order and are the same elements present in 𝑺[0..n] prior to the sorting procedure. In this case:</p><p>𝑺 = { 46, 2, 10, 5, 26, 13, 1 , 4, 52 }, prior to sorting</p><p>and, 𝑺 = { 1, 2, 4, 5, 10, 13, 26, 46, 52 } after sorting.</p><p>As a result of the initialization, maintenance and termination correctness criteria being verified, our insertion sort algorithm has been shown to be correct with loop invariants.</p><h4>Further reading:</h4><ol><li><a href="https://www.amazon.com/Introduction-Algorithms-Second-Thomas-Cormen/dp/0262032937">Introduction to Algorithms, Second Edition</a></li><li><a href="http://www.cs.cornell.edu/~asharp/papers/thesis.pdf">Incremental Algorithms: Solving problems in a changing world</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ffa6f5a716d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorithms deconstructed: An Introduction to algorithms]]></title>
            <link>https://medium.com/@iyanuadelekan/algorithms-deconstructed-an-introduction-to-algorithms-df051e79c925?source=rss-30bb3de4c373------2</link>
            <guid isPermaLink="false">https://medium.com/p/df051e79c925</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Iyanu Adelekan]]></dc:creator>
            <pubDate>Tue, 25 Oct 2016 22:30:16 GMT</pubDate>
            <atom:updated>2016-10-25T22:30:16.475Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*CvRWQgcTCWP0t7zPZLF8Gg.png" /></figure><p>If there’s one thing almost everyone has heard of at one point in time it’s the word algorithm. Surprisingly the true meaning behind this word has eluded many a man for decades. This post is meant to enlighten the average man about what these are about.</p><p>The first question that should be asked — for obvious reasons — is: What is an algorithm? A quick google search will present us with the following.</p><blockquote>A process or set of rules to be followed in calculations or other problem-solving operations, especially by a computer.</blockquote><p>You understand the definition? Great. You don’t understand? Let’s solve* that. Ensure you noticed how I said solve? We’ll talk more on that later.</p><p>First off, let’s do a break down of the definition we’re faced with. Two key nouns predestining the preposition ‘to’ were used in the definition . The first being ‘process’ and the second ‘set’. Let’s define a process in it’s most basic form as a sequence of tasks used to carry out a job or satisfy a goal. With this definition in mind, by a quick mental back-reference you can notice that you as a person carry out numerous processes on a day to day basis. Getting out of bed is a process. The same can be said about brushing your teeth, eating food, and at a grander scale being alive.</p><p>A set on the other hand can be said to be a collection of objects. Objects here can be anything e.g data, people, places. The list goes on. If you have two pens in hand, your hand contains a set of pens. One thing to keep in mind is that every set can be defined mathematically and as a consequence, so can algorithms — pretty neat right? Proceeding further by two words in our definition, the set we are considering is described better as a set containing rules. Rules are principles governing procedure in a particular field of activity —your activity here is a task.</p><p>At this point, it may be unclear to you the difference between rules and processes within the scope we are considering. I believe an analogy is in order.</p><p>If your boss at the office told you ‘Get off your lazy butt and <strong>scan those documents</strong>’ and you stopped whatever you were doing and <strong>scanned the documents, </strong>you just carried out a process. Many steps were involved in scanning the documents from the start point — you on your sit — to the point you completed scanning. At the barest minimum you would:</p><ol><li>Understand what your boss instructed you to do</li><li>Stop whatever you were doing (more appropriately, <strong>suspended </strong>whatever you were doing)</li><li>Get off your chair</li><li>Walk towards the scanner</li><li>Scan the documents</li></ol><p>It’s imperative to keep in mind that a process is not a rule. Let’s say your boss constantly reminded you to scan the documents every day and walked into the office orange faced and red eyed one morning and yelled: ‘As from this point onward, scan the documents at 11 o’clock every day!!!!!’, he has effectively defined a rule.</p><p>The rule above at surface level seems adequate but on close examination we will notice that the rule is very ambiguous. Does he mean eleven in the morning or eleven in the night? Does this mean from now on you must be at work every weekend to scan the documents by eleven? You might say the average person would be able to gracefully infer his employer’s meaning but in the realm of algorithm abstraction, clarity is key. Effectively re-defining the previous rule made, we can say: ‘As from this point onward, scan the documents at 11 o’clock in the morning every day, besides the weekends’.</p><blockquote>Scanning documents is a process.</blockquote><blockquote>‘As from this point onward, scan the documents at 11 o’clock every day’ is an ambiguously defined rule.</blockquote><blockquote>‘As from this point onward, scan the documents at 11 o’clock in the morning every day besides the weekends’ is a concise rule.</blockquote><p>Before moving on in the explanation of the definition, i’d like to point out that ambiguous definitions of rules in algorithms can lead to deep pitfalls in a system if such code is deployed. Conversely staunch rigidity in algorithmic structures and rules can lead to difficulties further down a software development process. Thus, proper planning of algorithms is invaluable in real world applications.</p><p>Up to this point, we’ve established the fact that an algorithm is a process or collection of rules. These rules and processes would be useless without an explicit purpose. The typical purpose of every algorithm is to be used in problem solving operations. As a consequence of this primary purpose, an algorithm can be further described to have a few other characteristics:</p><ol><li>It typically has input</li><li>It typically has feedback or at least one output (the problem solved)</li><li>It has a start point</li><li>It has a point of termination (an algorithm that never ends is useless in practice as it uses up vital resources such as memory and processing power)</li></ol><p>In most cases an algorithm that terminates with a correct is solely acceptable but there are a few problems which find use in incorrect answers and answers which are not exactly the optimal choice. An example of such a problem is the problem of Rank coloring. This problem is classified as an NP-complete problem.</p><blockquote>NP-complete: Class of problems containing the hardest problems existing in NP.</blockquote><p>NP-complete problems are problems that have no known possible efficient solution thus far. With the knowledge that no known efficient solution has been found for these problems in hand, a person who is mandated to come up with an efficient algorithm for a problem, can save himself a lot of trouble by identifying that the problem at hand is NP-complete (which can be done by logical proof). I’ll certainly cover NP more completely — see what I did there — more thoroughly further down the Algorithm deconstructed series but for now let’s to finish up this quick algorithm introduction.</p><p>Going back to my remark on solving the problem of not understanding algorithms, let’s right a brief (certainly not all encompassing) algorithm to solve the problem of teaching algorithms to people.</p><pre>start algorithm<br>   identify topics to teach<br>   read up on topics to teach<br>   get someone to explain topics to</pre><pre>   for each topic read<br>      explain topic<br>      if topic is understood<br>         continue to next topic<br>      else<br>         repeat on this topic<br>      end<br>   end<br>end algorithm</pre><p>If you are entirely new to algorithms, make sure you consciously read through all the steps in sequential order. Chances are, you understand the algorithm entirely without need of further explanation. If you don’t understand it’s fine, read over it a few more times and pen the algorithm down. The process of reading and writing algorithms in itself develops algorithmic understanding in people — seriously, it’s that easy! If after that you still don’t fully understand, leave a comment below and I’ll happily explain.</p><p>It’s worth pointing out that the algorithm above, is written in purely grammatical pseudocode. Pseudocode is not exactly machine understandable code but a higher level abstraction of code written purely towards the goal of clarity.</p><p>A final thing you should consider is If our pseudocode satisfies all the criteria required for it to be deemed an algorithm. Are there any improvements that can be made to our pseudocode? What are they? Pen them down or share in the comment section below.</p><p>We’ll discuss on the pros and cons of algorithms next Tuesday.</p><p>Till next time 👋🏾</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df051e79c925" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[And so the journey begins]]></title>
            <link>https://medium.com/@iyanuadelekan/and-so-the-journey-begins-1287d47998a3?source=rss-30bb3de4c373------2</link>
            <guid isPermaLink="false">https://medium.com/p/1287d47998a3</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[introduction]]></category>
            <category><![CDATA[first-post]]></category>
            <category><![CDATA[first]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Iyanu Adelekan]]></dc:creator>
            <pubDate>Mon, 24 Oct 2016 00:07:36 GMT</pubDate>
            <atom:updated>2016-10-24T00:07:36.318Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*QOHMrhTRkynxz9a5uQMpSA.jpeg" /></figure><p>Hey there, Iyanu here! This for me will probably be my most random (and most unsure) medium post ever. Why you ask? Because this is exactly what it is: an online post — which prior to now I’ve never done save for perhaps Facebook?</p><p>Honestly speaking, I don’t know where to go from here but since this is a first post I think an introduction might be in order.</p><blockquote>Hi i’m Iyanu ( pronounced /i:janʊˈ/ ) and I’m a young Nigerian dude who’s gained a considerable — likely smaller — amount of knowledge in software development, math and algorithms and is passionate about sharing that knowledge with people — aliens I have you in mind too.</blockquote><p>For those who are curious about what my posts will mainly centre around, you’ll just have to wait and find out. I kid, I kid. My posts will mainly be on:</p><ol><li>Algorithms</li><li>Mathematics</li><li>Software Development (code inclusive)</li><li>Machine Learning</li><li>Data Science</li><li>Arsenal FC Banter (just because)</li></ol><p>Besides the above, the occasional guest post and interview may pop up without warning but nothing too far off the topics above.</p><p>Now that we’ve gotten the intro and breakdown mumbo jumbo out of the way. Allow me to welcome you to what I imagine will be an amazing experience for anyone who cares to stick around.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*OQjz-ux4G4tyP5eFjOadkg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1287d47998a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>