<?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 Chiamaka Udechukwu on Medium]]></title>
        <description><![CDATA[Stories by Chiamaka Udechukwu on Medium]]></description>
        <link>https://medium.com/@chiamakabrowneyes?source=rss-886eec7064c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nCIcYgO9u0Svr7e1jWYcQw.jpeg</url>
            <title>Stories by Chiamaka Udechukwu on Medium</title>
            <link>https://medium.com/@chiamakabrowneyes?source=rss-886eec7064c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 15:12:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chiamakabrowneyes/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[How to approach Dynamic Programming Problems: A comprehensive tutorial for Beginners]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/operations-research-bit/5-beginner-level-dynamic-programming-questions-solutions-that-you-need-to-know-a-comprehensive-7a2e9169682a?source=rss-886eec7064c------2"><img src="https://cdn-images-1.medium.com/max/1792/0*KBIhJ8DGix2o1X_F" width="1792"></a></p><p class="medium-feed-snippet">Dynamic programming (DP) is one of the trickiest algorithm techniques. To simplify this DSA class, I created this tutorial to discuss and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/operations-research-bit/5-beginner-level-dynamic-programming-questions-solutions-that-you-need-to-know-a-comprehensive-7a2e9169682a?source=rss-886eec7064c------2">Continue reading on Operations Research Bit »</a></p></div>]]></description>
            <link>https://medium.com/operations-research-bit/5-beginner-level-dynamic-programming-questions-solutions-that-you-need-to-know-a-comprehensive-7a2e9169682a?source=rss-886eec7064c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a2e9169682a</guid>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[dynamic-programming]]></category>
            <category><![CDATA[data-structure-tutorial]]></category>
            <dc:creator><![CDATA[Chiamaka Udechukwu]]></dc:creator>
            <pubDate>Wed, 08 May 2024 06:16:46 GMT</pubDate>
            <atom:updated>2024-06-02T02:31:03.806Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Perform Core Binary Search Tree Algorithms: BST Insertion, Search, Deletion and Validation.]]></title>
            <link>https://medium.com/@chiamakabrowneyes/iterative-and-recursive-solution-for-constructing-a-binary-search-tree-using-bst-insertion-search-1db140e754b6?source=rss-886eec7064c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1db140e754b6</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[time-complexity]]></category>
            <category><![CDATA[binary-tree]]></category>
            <category><![CDATA[binary-search-tree]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Chiamaka Udechukwu]]></dc:creator>
            <pubDate>Fri, 03 May 2024 19:52:25 GMT</pubDate>
            <atom:updated>2024-05-08T07:21:07.917Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Definition</strong>: What is a Binary Search Tree?</blockquote><p>Binary Search Tree (BST) is a rooted binary tree where the nodes contain values that are ordered based on its strict rules of minimum and maximum values, which states that the value of a node is strictly greater than all the nodes on its left subtree but strictly less than (or equal to) all the nodes on its right subtree. This rule serves the purpose of creating an efficient logarithmic navigation system, where the search &amp; insertion algorithms are able to skip a half of the tree at each iteration.</p><p>In this article, I would engage in a comprehensive breakdown into the most important algorithms for binary search trees: Insertion, Search, Deletion, and Validation. The Search and Validation algorithms are non-destructive algorithms as they do not manipulate the current state of the Binary Seach Tree, rather they confirm if the BST contains a particular node value or is the BST abides by the fundamental principles of the BST. The Insertion and Deletion algorithms are destructive algorithms as they would potentially require the manipulation and reordering of the current state of a Binary Tree. This extent of adaptation is slightly more complex and may contain tricky edge cases, but I would do my best to simplify the explanation in the coming sections.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*R3xPC-Mw_jOareRO" /></figure><blockquote>Note: Not all Binary Trees are Binary Search Trees. A binary tree is a tree that contains at most two nodes (left and right child nodes). But a Binary Search Tree exists under the terms and rules mentioned above.</blockquote><p><strong>Initializing the Binary Search Tree</strong></p><p>We would need to characterizes the properties of a node in a BST. These properties include the node’s value, the node’s left child, and the node’s right child. Some BST Algorithms include the parent node as a property</p><p>In code, they can be defined as follows:</p><pre>class BST:<br>    def __init__(self, value):<br>        self.value = value<br>        self.left = None<br>        self.right = None</pre><p><strong>BST Search Algorithm</strong></p><p>The search algorithm starts from the root node and iterates through the tree and engages in a comparison that eliminates half of the tree in each round. With reference to the rule of a BST, we design the algorithm such that if the value for a current node is greater than the target value, then we will continue our search in the left subtree since all the other node values on the right subtree is guaranteed to also be greater than the target, and vice versa.</p><pre>def search(self, value):<br>   curr = self<br>   while curr is not None:<br>      if value &gt; curr.value:<br>         curr = curr.right<br>      elif value &lt; curr.value:<br>         curr = curr.left<br>      else:<br>         return True<br>   return False</pre><blockquote>Time Complexity for BST Search Algorithm: log(n)</blockquote><blockquote>Space Complexity for BST Search Algorithm: O(1)</blockquote><p><strong>BST Validation Algorithm</strong></p><p>The Validation algorithm operates in a tester pattern. It goes through every node in the tree to check that they abide by the rules of a BST. How so?Well, we can think of each node to have an apparent minimum and maximum value.</p><p>For a left node, the formula for this is that its parent value acts as its maximum. And for a right child node, its parent value acts as it minimum. Having no parents, the root node will initialize this algorithm with a min and max value of negative infinity and positive infinity, respectively. As we traverse down the tree, these min-max values change to maintain the fundamental property of a BST. Using this behavior, we can create a Validation algorithm that operates as follows:</p><pre>def validateBst(tree):<br>    #calling the recursive helper method with the necessary properties<br>    return validateHelper(tree, float(&quot;-inf&quot;), float(&quot;inf&quot;))<br><br>def validateHelper(tree, minValue, maxValue):<br>    #base case 1<br>    if tree is None:<br>        return True<br><br>    #base case 2<br>    if tree.value &lt; minValue or tree.value &gt;= maxValue:<br>        return False<br><br>    #recursively check the validity of the left and right sub trees<br>    leftTree = validateHelper(tree.left, minValue, tree.value)<br>    rightTree = validateHelper(tree.right, tree.value, maxValue)<br><br>    return leftTree and rightTree</pre><blockquote>Time Complexity for BST Validation Algorithm: O(n)</blockquote><blockquote>Space Complexity for BST Validation Algorithm: O(d), where d is depth of the tree</blockquote><p><strong>BST Insertion Algorithm</strong></p><p>The insertion algorithm operates as a finder behavior. First, we would find the most suitable spot in the tree, then we create a node value in that spot. Following through with the basic principles of the BST, we would find the left node, where the maximum and minimum values create a range that accommodates the value for the target node. This process is conceptualized in the algorithm below:</p><pre>def insert(self, value):<br>    curr = self<br><br>    while True:<br>        #check if target value is less than current node value<br>        if value &lt; curr.value:<br>            #since target value is less than we would like to add it to the left side of the tree<br>            if curr.left is None:<br>                #adding target value to leaf node<br>                curr.left = BST(value)<br>                break<br>            else: <br>                #continuing the circle until we find a leaf node<br>                curr = curr.left<br>        else: <br>            if curr.right is None:<br>                #adding target value to leaf node<br>                curr.right = BST(value)<br>                break<br>            else: <br>                #continuing the circle until we find a leaf node<br>                curr = curr.right<br>    return self</pre><blockquote>Time Complexity for BST Insertion Algorithm: log(n)</blockquote><blockquote>Space Complexity for BST Insertion Algorithm: O(1)</blockquote><p><strong>BST Deletion Algorithm</strong></p><p>The removal algorithm operates in two stages. In the first stage, you would have to find the target node, using an algorithm similar to the search method described above. In the second stage, you would have to engage in different insertion and replacement techniques that accommodate the different edge cases based on the position of the target node, explained below:</p><p>Edge cases:</p><ul><li>When the target node has two children: Find the smallest node on its right subtree, and replace that node’s value with the position of the target node. After that, delete the smallest node in its previous position.</li><li>When target node has no parent nodes: Replace the target node with its left subtree. If it has no left subtree, then replace it with its right subtree.</li><li>When the target node is the left child of its parent node: Replace the parent’s left node with the left child of the target node. If the left child doesn’t exist, then replace with the right child of the target node.</li><li>When the target node is the right child of its parent node: Replace the parent’s right node with the left child of the target node. If the left child doesn’t exist, then replace with the right child of the target node.</li></ul><pre>def remove(self, value, parent = None):<br>    curr = self<br><br>    while curr is not None:<br>        #find algorithm that tracks the parent node <br>        if curr.value &gt; value:<br>            parent = curr<br>            curr = curr.left<br><br>        elif curr.value &lt; value:<br>            parent = curr<br>            curr = curr.right<br><br>        #begin replacement<br>        else:<br>            #edge case for having both child nodes<br>            if curr.left is not None and curr.right is not None:<br>                #using helper function to get the smallest value on the right subtree<br>                curr.value = curr.right.getMin()<br>                curr.right.remove(curr.value, curr)<br><br>            #edge case for having no parent node<br>            elif parent is None:<br>                if curr.left is not None:<br>                    curr.value = curr.left.value<br>                    curr.right = curr.left.right<br>                    curr.left = curr.left.left<br><br>                elif curr.right is not None:<br>                    curr.value = curr.right.value<br>                    curr.left = curr.right.left<br>                    curr.right = curr.right.right<br><br>                #if the node has no parent and no children then we can ignore/nullify it<br>                else:<br>                    pass<br><br>            #edge case for if the target node is a left child<br>            elif parent.left == curr:<br>                parent.left = curr.left if curr.left is not None else curr.right<br><br>            #edge case for if the target node is a right child<br>            elif parent.right == curr:<br>                parent.right = curr.left if curr.left is not None else curr.right<br><br>            break<br><br>    return self<br><br>def getMin(self):<br>    curr = self<br>    <br>    #iterating to the leftmost node to get min value<br>    while curr.left is not None:<br>        curr = curr.left<br><br>    return curr.value</pre><blockquote>Time Complexity for BST Deletion Algorithm: log(n)</blockquote><blockquote>Space Complexity for BST Deletion Algorithm: O(1)</blockquote><p>Kudos on reading this article, I hope that I have simplified this problem appropriately. Feel free to let me know if you have further questions or comments. You could also follow me on <a href="https://medium.com/@chiamakabrowneyes">medium</a> and <a href="https://www.linkedin.com/in/udechukwu/">LinkedIn</a> for future tech related posts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1db140e754b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Gemini AI Assistant Chat App with Swift UI & Firebase : An Essential Breakdown]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@chiamakabrowneyes/build-a-gemini-ai-assistant-chat-app-with-swift-ui-firebase-an-essential-breakdown-c3932a30b44e?source=rss-886eec7064c------2"><img src="https://cdn-images-1.medium.com/max/1200/0*2HV6EyAiP4tv8b06.jpg" width="1200"></a></p><p class="medium-feed-snippet">In this comprehensive guide, we would explore the integration of Gemini&#x2019;s generative AI model in IOS development. Our journey will cover a&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@chiamakabrowneyes/build-a-gemini-ai-assistant-chat-app-with-swift-ui-firebase-an-essential-breakdown-c3932a30b44e?source=rss-886eec7064c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@chiamakabrowneyes/build-a-gemini-ai-assistant-chat-app-with-swift-ui-firebase-an-essential-breakdown-c3932a30b44e?source=rss-886eec7064c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3932a30b44e</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[api-development]]></category>
            <category><![CDATA[geminipro]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[Chiamaka Udechukwu]]></dc:creator>
            <pubDate>Mon, 29 Apr 2024 01:29:15 GMT</pubDate>
            <atom:updated>2024-04-29T01:32:37.375Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to hide API keys in Xcode code Swift UI — The most efficient way.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@chiamakabrowneyes/how-to-hide-api-keys-in-xcode-code-swift-ui-the-most-efficient-way-c029326c172a?source=rss-886eec7064c------2"><img src="https://cdn-images-1.medium.com/max/600/0*MBIocskaVhR4dIHE.png" width="600"></a></p><p class="medium-feed-snippet">An API key is a simplified encrypted key that facilitates the authentication of a user to a particular service. For instance, an Open AI&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@chiamakabrowneyes/how-to-hide-api-keys-in-xcode-code-swift-ui-the-most-efficient-way-c029326c172a?source=rss-886eec7064c------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@chiamakabrowneyes/how-to-hide-api-keys-in-xcode-code-swift-ui-the-most-efficient-way-c029326c172a?source=rss-886eec7064c------2</link>
            <guid isPermaLink="false">https://medium.com/p/c029326c172a</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[data-protection]]></category>
            <dc:creator><![CDATA[Chiamaka Udechukwu]]></dc:creator>
            <pubDate>Thu, 25 Apr 2024 14:01:17 GMT</pubDate>
            <atom:updated>2024-05-11T14:26:08.151Z</atom:updated>
        </item>
    </channel>
</rss>