<?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 CS Unfolds on Medium]]></title>
        <description><![CDATA[Stories by CS Unfolds on Medium]]></description>
        <link>https://medium.com/@csunfolds?source=rss-fee89c414f35------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5YGST28ygnFu-SLSTyUROw.png</url>
            <title>Stories by CS Unfolds on Medium</title>
            <link>https://medium.com/@csunfolds?source=rss-fee89c414f35------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:19:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@csunfolds/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[Evaluate Postfix Expression Using Stack: Step-by-Step Explanation with Example]]></title>
            <link>https://medium.com/@csunfolds/evaluate-postfix-expression-using-stack-step-by-step-explanation-with-example-a28ad3491ea8?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/a28ad3491ea8</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[postfix-expression]]></category>
            <category><![CDATA[stack-data-structure]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Fri, 29 May 2026 12:31:00 GMT</pubDate>
            <atom:updated>2026-05-29T12:31:00.927Z</atom:updated>
            <content:encoded><![CDATA[<h4>Learn how stack data structure is used to solve postfix expressions in an easy and structured way.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWY6mY82l4NmO0u-l1rwYw.jpeg" /><figcaption>Evaluate Postfix Expression Using Stack</figcaption></figure><p><strong>Given Expression (Postfix):</strong><br> 10 2 + 8 4 / * 6 3 - /</p><p>We will evaluate this using a <strong>stack</strong>, where:</p><ul><li>Operands (numbers) are pushed into the stack</li><li>Operators pop required operands, perform the operation, and push the result back</li></ul><p>Think of a stack like a stack of plates. You can only add or remove from the top.</p><p>In postfix evaluation:</p><ul><li>Whenever we see a number, we <strong>push it into the stack</strong></li><li>Whenever we see an operator, we <strong>take the top two numbers</strong>, perform the operation, and push the result back</li></ul><p>Let’s solve step by step.</p><p>Expression:<br> 10 2 + 8 4 / * 6 3 - /</p><h3>Step-by-step execution:</h3><p><strong>Step 1: Push 10</strong><br> Stack: [10]</p><p><strong>Step 2: Push 2</strong><br> Stack: [10, 2]</p><p><strong>Step 3: +</strong><br> 10 + 2 = 12<br> Stack: [12]</p><p><strong>Step 4: Push 8</strong><br> Stack: [12, 8]</p><p><strong>Step 5: Push 4</strong><br> Stack: [12, 8, 4]</p><p><strong>Step 6: /</strong><br> 8 / 4 = 2<br> Stack: [12, 2]</p><p><strong>Step 7: <br></strong> 12 × 2 = 24<br> Stack: [24]</p><p><strong>Step 8: Push 6</strong><br> Stack: [24, 6]</p><p><strong>Step 9: Push 3</strong><br> Stack: [24, 6, 3]</p><p><strong>Step 10: -</strong><br> 6–3 = 3<br> Stack: [24, 3]</p><p><strong>Step 11: /</strong><br> 24 / 3 = 8<br> Stack: [8]</p><h3>Final Answer:</h3><p><strong>Result = 8</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a28ad3491ea8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is Recursion? Factorial Program in C Using Recursive Function Explained]]></title>
            <link>https://medium.com/@csunfolds/what-is-recursion-factorial-program-in-c-using-recursive-function-explained-2dd7ba328420?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/2dd7ba328420</guid>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[factorial-program]]></category>
            <category><![CDATA[recursive-function]]></category>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Fri, 22 May 2026 12:31:00 GMT</pubDate>
            <atom:updated>2026-05-22T12:31:00.690Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understand the concept of recursive functions in C with a clear factorial program and explanation.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ojEtVZ_7JGyhrFIK-tLuA.jpeg" /><figcaption>What Is Recursion? Factorial Program in C Using Recursive Function Explained</figcaption></figure><p>Today we are going to learn a very interesting concept called <strong>recursion</strong>.</p><p>Let’s start with a simple real-life example.</p><p>Imagine you are standing between two mirrors facing each other. What do you see? You see an image inside an image, repeating again and again. This repeating pattern is similar to recursion.</p><p>Now in programming, <strong>recursion</strong> means a function calling itself.</p><p>But wait, if a function keeps calling itself forever, won’t it run endlessly? Yes, and that’s why recursion must have a <strong>stopping condition</strong>, called the <strong>base case</strong>.</p><p>Let’s understand this with an example: <strong>factorial of a number</strong>.</p><p>Factorial is written as:</p><ul><li>5! = 5 × 4 × 3 × 2 × 1 = 120</li></ul><p>But we can also write it like this:</p><ul><li>5! = 5 × 4!</li><li>4! = 4 × 3!</li><li>3! = 3 × 2!</li><li>2! = 2 × 1!</li><li>1! = 1 (this is the base case)</li></ul><p>So instead of calculating everything at once, we break it into smaller problems. Each step calls the same function again with a smaller value.</p><p>This is recursion:</p><ul><li>Solve a big problem by solving smaller versions of the same problem.</li></ul><p><strong>Key parts of recursion</strong>:</p><ol><li><strong>Recursive case</strong>: Function calls itself</li><li><strong>Base case</strong>: Condition where recursion stops</li></ol><p>If we don’t define the base case, the program will run infinitely and crash.</p><p>Now let’s see a <strong>recursive C program to calculate factorial</strong>:</p><pre>#include &lt;stdio.h&gt;<br><br>// Recursive function to calculate factorial<br>int factorial(int n) {<br>    if (n == 0 || n == 1)  // Base case<br>        return 1;<br>    else<br>        return n * factorial(n - 1);  // Recursive call<br>}<br>int main() {<br>    int num;<br>    <br>    printf(&quot;Enter a number: &quot;);<br>    scanf(&quot;%d&quot;, &amp;num);<br>    <br>    printf(&quot;Factorial of %d = %d&quot;, num, factorial(num));<br>    <br>    return 0;<br>}</pre><p><strong>How it works</strong> (for n = 5):</p><ul><li>factorial(5) = 5 × factorial(4)</li><li>factorial(4) = 4 × factorial(3)</li><li>factorial(3) = 3 × factorial(2)</li><li>factorial(2) = 2 × factorial(1)</li><li>factorial(1) = 1 (base case)</li></ul><p>Then values return back step by step:</p><ul><li>factorial(2) = 2 × 1 = 2</li><li>factorial(3) = 3 × 2 = 6</li><li>factorial(4) = 4 × 6 = 24</li><li>factorial(5) = 5 × 24 = 120</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dd7ba328420" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Static, Dynamic, Linear, and Non-Linear Types in Data Structures]]></title>
            <link>https://medium.com/@csunfolds/static-dynamic-linear-and-non-linear-types-in-data-structures-36439fe7a459?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/36439fe7a459</guid>
            <category><![CDATA[types-of-data-structure]]></category>
            <category><![CDATA[dynamic-data-structures]]></category>
            <category><![CDATA[nonlinear-data-structure]]></category>
            <category><![CDATA[linear-data-structure]]></category>
            <category><![CDATA[static-data-structure]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Fri, 15 May 2026 12:31:00 GMT</pubDate>
            <atom:updated>2026-05-15T12:31:00.885Z</atom:updated>
            <content:encoded><![CDATA[<h4>A beginner-friendly guide explaining different types of data structures with simple definitions and examples.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kWnrs8hCX1td_4NqDpQ2gg.jpeg" /><figcaption>Static, Dynamic, Linear, and Non-Linear Types in Data Structures</figcaption></figure><p>Let’s understand four important types of data structures: <strong>static, dynamic, linear, and non-linear</strong>. Don’t worry, we’ll keep it simple and use real-life examples.</p><p>First, let’s talk about <strong>static data structures</strong>.</p><p>Imagine you have a fixed number of seats in a classroom, say 30 seats. No matter what, you cannot easily increase or decrease this number during the lecture. This is similar to a static data structure.<br> A <strong>static data structure</strong> has a fixed size, which is defined before the program runs, and it cannot grow or shrink easily.</p><p>Example: <strong>Array</strong><br> If you create an array of size 5, you can only store 5 elements. Not more, not less.</p><p>Now, let’s move to <strong>dynamic data structures</strong>.</p><p>Think about a queue at a bus stop. People can join the line or leave it anytime. The size keeps changing depending on how many people are there.<br> A <strong>dynamic data structure</strong> can grow or shrink during runtime as needed.</p><p>Example: <strong>Linked List</strong><br> You can keep adding or removing nodes without worrying about fixed size.</p><p>Next, we have <strong>linear data structures</strong>.</p><p>Imagine a train. Each compartment is connected one after another in a straight line. You can move from one to the next in sequence.<br> A <strong>linear data structure</strong> stores elements in a sequential manner, where each element is connected to its previous and next element.</p><p>Examples:</p><ul><li>Array</li><li>Linked List</li><li>Stack</li><li>Queue</li></ul><p>Finally, let’s understand <strong>non-linear data structures</strong>.</p><p>Think of a family tree. One person can have multiple children, and the structure branches out. It is not a straight line.<br> A <strong>non-linear data structure</strong> stores data in a hierarchical or interconnected way, not sequentially.</p><p>Examples:</p><ul><li>Tree</li><li>Graph</li></ul><p><strong>Quick recap</strong>:</p><ul><li>Static → Fixed size</li><li>Dynamic → Size can change</li><li>Linear → Elements in sequence</li><li>Non-linear → Elements in hierarchy or network</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36439fe7a459" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is a Data Structure? Key Differences Between Data Types and Data Structures Explained]]></title>
            <link>https://medium.com/@csunfolds/what-is-a-data-structure-key-differences-between-data-types-and-data-structures-explained-112735088c05?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/112735088c05</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-type]]></category>
            <category><![CDATA[computer-science-basics]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[fundamental-programming]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Fri, 08 May 2026 12:31:00 GMT</pubDate>
            <atom:updated>2026-05-08T12:31:00.987Z</atom:updated>
            <content:encoded><![CDATA[<h4>A simple beginner-friendly guide explaining the concept of data structures and how they differ from data types with easy examples.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ManHkXaaGnEStjUZX8HHw.jpeg" /><figcaption>Differences Between Data Types and Data Structures</figcaption></figure><p>let’s start from the basics.</p><p>Imagine you have different kinds of items at home like books, clothes, and toys. Now, not only do you have these items, but you also arrange them properly. Books go on shelves, clothes in cupboards, and toys in boxes. Why? So that you can easily find and use them when needed.</p><p>In computers, something similar happens.</p><p>First, we have <strong>data types</strong>. These are like the types of items you have. For example:</p><p>Numbers like 10, 25 are stored as <strong>integers</strong><br>Decimal values like 3.14 are <strong>floats</strong><br>Letters like ‘A’ or words are <strong>characters</strong> or <strong>strings</strong></p><p>So, data types tell us what kind of data we are dealing with.</p><p>Now comes <strong>data structures</strong>. These are like the ways we organize those items. A data structure defines how data is arranged, stored, and accessed in memory.</p><p>For example:</p><p>A <strong>list </strong>or <strong>array </strong>is like a row of lockers where each item has a fixed position.<br>A <strong>stack </strong>is like a pile of plates. You add and remove from the top.<br>A <strong>queue </strong>is like a line at a ticket counter. First person in is the first one out.</p><p>So, data structures help us manage data efficiently so that operations like searching, inserting, and deleting become faster and easier.</p><p>Now let’s clearly differentiate between the two.</p><h3>Data Types vs Data Structures:</h3><h4>Definition:</h4><p>Data Type<strong>:</strong> Defines the type of value a variable can hold.<br>Data Structure: Defines how multiple data values are organized and managed.</p><h4>Purpose:</h4><ul><li>Data Type: Specifies the nature of data.</li><li>Data Structure: Improves efficiency in handling data.</li></ul><h4>Complexity:</h4><ul><li>Data Type: Simple and basic.</li><li>Data Structure: More complex and can be built using data types.</li></ul><h4>Examples:</h4><ul><li>Data Type: int, float, char</li><li>Data Structure: array, stack, queue, linked list</li></ul><h4>Relationship:</h4><p>Data structures are built using data types.</p><h4>So in simple words:</h4><p>Data type tells you what the data is, and data structure tells you how the data is organized.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=112735088c05" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Difference Between Linear and Binary Search in Time Complexity]]></title>
            <link>https://medium.com/@csunfolds/difference-between-linear-and-binary-search-in-time-complexity-4b52ec2deb10?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b52ec2deb10</guid>
            <category><![CDATA[binary-search]]></category>
            <category><![CDATA[linear-search]]></category>
            <category><![CDATA[time-complexity]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[difference]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Fri, 17 Apr 2026 12:31:01 GMT</pubDate>
            <atom:updated>2026-04-17T12:31:01.457Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4K_l3vI29aBXsJAlx1PONw.jpeg" /><figcaption>Difference Between Linear and Binary Search</figcaption></figure><p>Let’s understand <strong>Linear Search</strong> and <strong>Binary Search</strong> in a simple and practical way.</p><h3>1. What is Linear Search?</h3><p>Imagine you are looking for a book in a messy pile. You check each book one by one until you find the one you want.</p><p>That is exactly how <strong>linear search</strong> works.</p><ul><li>Start from the first element</li><li>Compare each element with the target</li><li>Stop when found or when the list ends</li></ul><p>👉 Example:<br> If you have numbers [5, 2, 9, 1, 7] and you want to find 7, you check:<br> 5 → 2 → 9 → 1 → 7</p><h3>2. What is Binary Search?</h3><p>Now imagine books are arranged in <strong>sorted order</strong>. Instead of checking one by one, you open the middle and decide:</p><ul><li>If the book is smaller, go left</li><li>If larger, go right</li></ul><p>This is <strong>binary search</strong>.</p><p>👉 Important condition: Data must be <strong>sorted</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*lFePYuOckR9HU32I2UibLg.png" /><figcaption>Time Complexity of Linear Search vs Binary Search</figcaption></figure><h3>How Binary Search Works</h3><p>Example: Find 7 in [1, 2, 5, 7, 9]</p><ol><li>Check middle → 5</li><li>7 &gt; 5 → go right</li><li>Check 7 → found</li></ol><p>Instead of checking all elements, we eliminate half each time.</p><h3>Time Complexity Comparison (Simple Idea)</h3><ul><li>Linear Search: checks <strong>one by one</strong></li><li>Binary Search: <strong>divides the list into half repeatedly</strong></li></ul><h3>Real Life Analogy</h3><ul><li>Linear Search → searching a contact by scrolling</li><li>Binary Search → searching using alphabetical sections</li></ul><h3>Final Understanding</h3><ul><li>Linear search is simple but slow for large data</li><li>Binary search is fast but requires sorted data</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b52ec2deb10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Recursive Approach to Solve the Tower of Hanoi Problem]]></title>
            <link>https://medium.com/@csunfolds/easy-recursive-approach-to-solve-the-tower-of-hanoi-problem-4d6f4427e872?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d6f4427e872</guid>
            <category><![CDATA[tower-of-hanoi]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[solve]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[recursive]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 12:31:01 GMT</pubDate>
            <atom:updated>2026-04-10T12:31:01.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OfeXfCUZyeEQJuvmy6n03Q.jpeg" /><figcaption>Easy Recursive Approach to Solve the Tower of Hanoi Problem</figcaption></figure><p>Let’s understand the <strong>Tower of Hanoi</strong> problem step by step in a simple way.</p><p>Imagine you have <strong>three rods</strong> and a set of <strong>disks of different sizes</strong> stacked on one rod. The disks are arranged such that the largest disk is at the bottom and the smallest is on top, like a pyramid.</p><p>Your goal is to <strong>move all the disks from the first rod (source) to the third rod (destination)</strong> using the second rod (auxiliary), while following these rules:</p><ol><li>You can move <strong>only one disk at a time</strong>.</li><li>You can only move the <strong>top disk</strong> from any rod.</li><li>You cannot place a <strong>larger disk on top of a smaller disk</strong>.</li></ol><h3>Understanding Recursion in This Problem</h3><p>Instead of thinking about moving all disks at once, we solve it <strong>step by step using recursion</strong>.</p><p>Let’s say we have <strong>3 disks</strong>:</p><p>To move 3 disks from Source (A) to Destination ©, we do:</p><ol><li>Move <strong>2 disks</strong> from A to B using C</li><li>Move <strong>1 disk</strong> from A to C</li><li>Move <strong>2 disks</strong> from B to C using A</li></ol><p>Notice something interesting:<br> We reduced the problem of 3 disks into solving the same problem for <strong>2 disks</strong>. This is the idea of <strong>recursion</strong>.</p><h3>Base Case</h3><p>If there is <strong>only 1 disk</strong>, just move it directly from source to destination.</p><h3>Recursive Logic</h3><p>To move n disks:</p><ol><li>Move n-1 disks from source to auxiliary</li><li>Move the nth disk from source to destination</li><li>Move n-1 disks from auxiliary to destination</li></ol><h3>Recursive Function (Concept)</h3><pre>TOH(n, source, auxiliary, destination)</pre><ul><li>If n == 1 → move disk directly</li><li>Otherwise:</li><li>Call TOH(n-1, source, destination, auxiliary)</li><li>Move disk n</li><li>Call TOH(n-1, auxiliary, source, destination)</li></ul><h3>Algorithm</h3><pre>TOH(n, source, auxiliary, destination)<br>{<br>    if (n == 1)<br>    {<br>        print &quot;Move disk 1 from source to destination&quot;<br>        return<br>    }<br><br>TOH(n-1, source, destination, auxiliary)<br>    print &quot;Move disk n from source to destination&quot;<br>    TOH(n-1, auxiliary, source, destination)<br>}</pre><h3>Example (n = 2)</h3><p>Steps:</p><ol><li>Move disk 1 from A to B</li><li>Move disk 2 from A to C</li><li>Move disk 1 from B to C</li></ol><h3>Time Complexity</h3><ul><li>Number of moves required = 2n−12^n — 12n−1</li><li>Time Complexity = <strong>O(2ⁿ)</strong></li></ul><h3>Key Points</h3><ul><li>Uses recursion effectively</li><li>Breaks problem into smaller subproblems</li><li>Base case is essential to stop recursion</li><li>Widely used to understand recursive thinking</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d6f4427e872" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Full, Complete, and Skewed Binary Tree Explained (With Simple Definitions & Examples)]]></title>
            <link>https://medium.com/@csunfolds/full-complete-and-skewed-binary-tree-explained-with-simple-definitions-examples-02c03f7c91c5?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/02c03f7c91c5</guid>
            <category><![CDATA[binary-tree]]></category>
            <category><![CDATA[complete-binary-tree]]></category>
            <category><![CDATA[skewed-binary-tree]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[full-binary-tree]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Tue, 10 Mar 2026 10:31:00 GMT</pubDate>
            <atom:updated>2026-03-10T10:31:00.812Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ikTYrNiE80pVhzovSmuXbw.png" /><figcaption>Full, Complete, and Skewed Binary Tree Explained</figcaption></figure><p>Today we are going to understand three important types of binary trees. Before we start, let us quickly remember what a <strong>binary tree</strong> is.</p><p>A binary tree is a tree data structure where each node can have at most two children. These children are usually called the left child and the right child.</p><p>Now let us understand the three types one by one in a very simple way.</p><h3>1. Full Binary Tree</h3><p>Imagine a classroom where every bench has exactly two students sitting, or no students at all. No bench has only one student. That is similar to a Full Binary Tree.</p><p>In a Full Binary Tree, every node has either:</p><ul><li>Exactly two children, or</li><li>No children at all (these are called leaf nodes)</li></ul><p>It cannot have only one child.</p><p>Example:<br>If a parent node has two children, that is fine.<br>If a node has zero children, that is also fine.<br>But if a node has only one child, then it is NOT a full binary tree.</p><p>So the rule is simple:<br>Either 0 children or 2 children.</p><h3>2. Complete Binary Tree</h3><p>Now imagine you are filling seats in a movie theatre row by row from left to right. You do not leave empty seats in between.</p><p>A Complete Binary Tree works in a similar way.</p><p>In a Complete Binary Tree:</p><ul><li>All levels are completely filled except possibly the last level.</li><li>In the last level, nodes are filled from left to right without gaps.</li></ul><p>This means:</p><ul><li>No empty space is allowed between nodes.</li><li>Nodes should be as left as possible.</li></ul><p>Complete Binary Trees are very important because they are used in heap data structures.</p><h3>3. Skewed Binary Tree</h3><p>Now imagine a tree that grows only in one direction, either completely left or completely right.</p><p>In a Skewed Binary Tree:</p><ul><li>Every node has only one child.</li><li>It looks like a straight line.</li></ul><p>There are two types:</p><ol><li>Left Skewed Tree — All nodes have only left child.</li><li>Right Skewed Tree — All nodes have only right child.</li></ol><p>It looks more like a linked list than a proper tree.</p><p>So in short:</p><ul><li>Full Binary Tree → 0 or 2 children only.</li><li>Complete Binary Tree → Filled level by level from left to right.</li><li>Skewed Binary Tree → Each node has only one child.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=02c03f7c91c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Binary Search Tree Construction with Preorder, Inorder, and Postorder Traversal (Step-by-Step…]]></title>
            <link>https://medium.com/@csunfolds/binary-search-tree-construction-with-preorder-inorder-and-postorder-traversal-step-by-step-c62cf56b8118?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/c62cf56b8118</guid>
            <category><![CDATA[binary-search-tree]]></category>
            <category><![CDATA[tree-traversal-algorithm]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[data-structures-in-python]]></category>
            <category><![CDATA[bst-construction-steps]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Wed, 04 Mar 2026 12:52:24 GMT</pubDate>
            <atom:updated>2026-03-04T12:52:24.937Z</atom:updated>
            <content:encoded><![CDATA[<h3>Binary Search Tree Construction with Preorder, Inorder, and Postorder Traversal (Step-by-Step Guide)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GbFDurakidx005Rh3mlFTA.png" /><figcaption>Binary Search Tree Construction with Preorder, Inorder, and Postorder Traversal</figcaption></figure><h3>Data</h3><p>The input sequence is: <strong>21, 51, 12, 45, 17, 71, 19, 47, 78</strong></p><h3>1. BST Construction Steps</h3><p>A Binary Search Tree (BST) follows the rule: for any node, the left subtree contains values less than the node, and the right subtree contains values greater than the node.</p><ol><li><strong>Insert 21:</strong> Root of the tree.</li><li><strong>Insert 51:</strong> $51 &gt; 21$, moves to the <strong>right</strong> of 21.</li><li><strong>Insert 12:</strong> $12 &lt; 21$, moves to the <strong>left</strong> of 21.</li><li><strong>Insert 45:</strong> $45 &gt; 21$, then $45 &lt; 51$, moves to the <strong>left</strong> of 51.</li><li><strong>Insert 17:</strong> $17 &lt; 21$, then $17 &gt; 12$, moves to the <strong>right</strong> of 12.</li><li><strong>Insert 71:</strong> $71 &gt; 21$, then $71 &gt; 51$, moves to the <strong>right</strong> of 51.</li><li><strong>Insert 19:</strong> $19 &lt; 21$, then $19 &gt; 12$, then $19 &gt; 17$, moves to the <strong>right</strong> of 17.</li><li><strong>Insert 47:</strong> $47 &gt; 21$, then $47 &lt; 51$, then $47 &gt; 45$, moves to the <strong>right</strong> of 45.</li><li><strong>Insert 78:</strong> $78 &gt; 21$, then $78 &gt; 51$, then $78 &gt; 71$, moves to the <strong>right</strong> of 71.</li></ol><h3>Visual Representation</h3><pre>21<br>       /  \<br>     12    51<br>      \    / \<br>      17  45  71<br>       \   \    \<br>       19  47   78</pre><h3>2. Tree Traversals</h3><h3>Pre-order Traversal (Root, Left, Right)</h3><p>In this traversal, we visit the root node first, then recursively visit the left subtree, followed by the right subtree.</p><ul><li><strong>Sequence:</strong> 21, 12, 17, 19, 51, 45, 47, 71, 78</li></ul><h3>In-order Traversal (Left, Root, Right)</h3><p>In this traversal, we visit the left subtree, then the root node, and finally the right subtree. For a BST, this always results in a sorted list of elements.</p><ul><li><strong>Sequence:</strong> 12, 17, 19, 21, 45, 47, 51, 71, 78</li></ul><h3>Post-order Traversal (Left, Right, Root)</h3><p>In this traversal, we visit the left subtree, then the right subtree, and finally the root node.</p><ul><li><strong>Sequence:</strong> 19, 17, 12, 47, 45, 78, 71, 51, 2</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c62cf56b8118" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is a Hash Function? Features and Characteristics of a Good Hashing Algorithm]]></title>
            <link>https://medium.com/@csunfolds/what-is-a-hash-function-features-and-characteristics-of-a-good-hashing-algorithm-545e60c1d06a?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/545e60c1d06a</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[hash-function]]></category>
            <category><![CDATA[hashing]]></category>
            <category><![CDATA[uniform-distribution]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Thu, 19 Feb 2026 12:31:01 GMT</pubDate>
            <atom:updated>2026-02-19T12:31:01.090Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding Hashing in Data Structures with Key Concepts and Examples. Learn the Properties of a Good Hash Function for Efficient Data Storage and Retrieval</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pED9tfafDFJ8qGTu9jTtsQ.jpeg" /><figcaption>What Is a Hash Function? Features and Characteristics of a Good Hashing Algorithm</figcaption></figure><p>Today we will understand <strong>what hashing is</strong> and the <strong>properties of a good hash function</strong> in Data Structures.</p><p>First, imagine you have a large cupboard with 100 drawers, and you want to store student records. Instead of searching through every drawer each time, you want a quick method to decide exactly which drawer to use for each student.</p><p>This is where <strong>hashing</strong> comes in.</p><h3>What is Hashing?</h3><p>Hashing is a technique used to <strong>store and retrieve data quickly</strong>. It uses a special function called a <strong>hash function</strong> to convert a key (like a roll number or name) into an index (position) in a table.</p><p>This table is called a <strong>hash table</strong>.</p><p>For example:</p><p>Suppose we have roll number 123 and table size is 10.<br> We can use a simple hash function:</p><pre>h(key) = key % 10</pre><p>So,</p><p>h(123) = 123 % 10 = 3</p><p>This means the record will be stored at index 3 of the hash table.</p><p>Instead of searching the whole table, we directly go to index 3. This makes searching very fast (almost O(1) time complexity).</p><h3>What is a Hash Function?</h3><p>A hash function is a mathematical function that converts a large key into a smaller integer (index value).</p><p>Now, not all hash functions are good. If many keys go to the same index, it causes <strong>collision</strong> (two keys mapping to same location). So we need a <strong>good hash function</strong>.</p><h3>Properties of a Good Hash Function</h3><ol><li><strong>Uniform Distribution</strong><br> It should distribute keys evenly across the hash table to reduce collisions.</li><li><strong>Deterministic</strong><br> The same key must always produce the same hash value.</li><li><strong>Fast Computation</strong><br> The function should be simple and quick to compute.</li><li><strong>Minimizes Collisions</strong><br> Different keys should ideally produce different hash values.</li><li><strong>Uses All Key Information</strong><br> It should consider the entire key, not just a part of it.</li></ol><h3>Simple Example</h3><p>If we use:</p><pre>h(key) = key % 10</pre><p>It works well when numbers are evenly distributed. But if all keys end with the same digit (like 10, 20, 30), then they all go to the same index → causing collision.</p><p>So, a good hash function spreads data properly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=545e60c1d06a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Recursion Uses the Stack in Data Structures (Clear Guide + Examples)]]></title>
            <link>https://medium.com/@csunfolds/how-recursion-uses-the-stack-in-data-structures-clear-guide-examples-3710756c0ccb?source=rss-fee89c414f35------2</link>
            <guid isPermaLink="false">https://medium.com/p/3710756c0ccb</guid>
            <category><![CDATA[recursion]]></category>
            <category><![CDATA[stack-in-recursion]]></category>
            <category><![CDATA[stack]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[call-stack]]></category>
            <dc:creator><![CDATA[CS Unfolds]]></dc:creator>
            <pubDate>Sun, 15 Feb 2026 12:31:05 GMT</pubDate>
            <atom:updated>2026-02-15T12:31:05.551Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding the Role of Stack in Recursion with Clear Examples. Learn how the call stack manages recursive function calls in Data Structures</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mTV8c1Bllqf__U9WyVgN8w.png" /><figcaption>How Recursion Uses the Stack in Data Structures</figcaption></figure><p>Today, we are going to understand <strong>how a stack is used in recursion</strong>.</p><p>First, let’s quickly recall what a <strong>stack</strong> is. A stack is a linear data structure that follows the rule <strong>LIFO (Last In, First Out)</strong>. Imagine a stack of plates in a kitchen. You put a plate on top, and when you need one, you remove the top plate first. You cannot remove the plate from the middle directly.</p><p>Now let’s understand <strong>recursion</strong>. Recursion is a method where a function calls itself to solve a smaller part of a problem. For example, to calculate factorial of 4 (4!), we can write:</p><p>4! = 4 × 3!<br> 3! = 3 × 2!<br> 2! = 2 × 1!<br> 1! = 1</p><p>Here, the function keeps calling itself until it reaches a stopping condition (called the <strong>base case</strong>).</p><p>Now, how does stack come into picture?</p><p>Whenever a function is called, the system stores some information about that function in memory. This memory area is called the <strong>call stack</strong>. The call stack works exactly like a stack data structure.</p><p>Let’s understand with the factorial example:</p><p>Suppose we calculate factorial(3).</p><ol><li>factorial(3) is called → stored in stack</li><li>factorial(2) is called → stored on top of factorial(3)</li><li>factorial(1) is called → stored on top of factorial(2)</li></ol><p>Now stack looks like this (top to bottom):</p><p>factorial(1)<br>factorial(2)<br>factorial(3)</p><p>When factorial(1) reaches the base case, it returns 1. Then:</p><ul><li>factorial(1) is removed from stack (popped)</li><li>factorial(2) resumes execution</li><li>Then factorial(2) is removed</li><li>Finally factorial(3) completes and is removed</li></ul><p>So, <strong>each recursive call is pushed onto the stack</strong>, and when the function finishes, it is <strong>popped from the stack</strong>.</p><p>This is why deep recursion can cause <strong>stack overflow</strong>. If too many recursive calls are made without reaching the base case, the stack memory becomes full.</p><p>So in simple words:</p><ul><li>Recursion uses the system’s <strong>call stack</strong></li><li>Each function call is pushed onto the stack</li><li>When the function completes, it is popped from the stack</li><li>Stack helps keep track of function calls and their local variables</li></ul><p>That is how stack is used in recursion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3710756c0ccb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>