<?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 Aathil Yoosuf on Medium]]></title>
        <description><![CDATA[Stories by Aathil Yoosuf on Medium]]></description>
        <link>https://medium.com/@yoosufaath007?source=rss-f3da0b854eb0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*poRzZ8TT7J4RuP3tA6oVnQ.jpeg</url>
            <title>Stories by Aathil Yoosuf on Medium</title>
            <link>https://medium.com/@yoosufaath007?source=rss-f3da0b854eb0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:03:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yoosufaath007/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[From Bootcamp to Builder: How a 2023 Beginner Program Opened My Salesforce Path]]></title>
            <link>https://medium.com/@yoosufaath007/from-bootcamp-to-builder-how-a-2023-beginner-program-opened-my-salesforce-path-bd4afde07e00?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd4afde07e00</guid>
            <category><![CDATA[trailhead]]></category>
            <category><![CDATA[trail-mix]]></category>
            <category><![CDATA[yarl-salesforce-ohana]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[learning-journey]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 15:52:33 GMT</pubDate>
            <atom:updated>2025-11-17T15:52:33.695Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*Q_X523ZDuhkIZQzL7T9jmg.png" /></figure><h3>Why this series</h3><p>This series documents a real learner’s path into Salesforce — what sparked the journey, what’s been learned so far, where motivation comes from, and the challenges that shaped discipline.<br>Writing in public keeps the focus on consistent practice and community-led progress over perfection.</p><h3>The entrance</h3><p>The door opened in 2023 when the Salesforce Beginner Bootcamp organized by the Yarl Salesforce Ohana made the platform feel welcoming and achievable for a student developer.​</p><p>You can watch the session from here: <a href="https://youtube.com/playlist?list=PLzNwz72XCp-c7QKlWZeu0t-wniEMjSpMq&amp;si=D6LNksKVt_lVN8Jp">https://youtube.com/playlist?list=PLzNwz72XCp-c7QKlWZeu0t-wniEMjSpMq&amp;si=D6LNksKVt_lVN8Jp</a></p><p>YSFO’s mission to grow Sri Lankan cloud talent resonated deeply and showed how a community can accelerate both confidence and capability.​</p><h3>Early traction on Trailhead</h3><p>Bootcamp momentum carried into Trailhead where the cohort’s curated Trailmix became the map for structured learning and quick wins.​<br>Working through modules built the habit of hands-on learning and gave a practical foundation to understand how Salesforce solves real business problems.</p><h3>Personal perspective</h3><p>Salesforce clicked because it blends engineering with customer outcomes — automation, security, data, and integrations that translate directly to value for teams and users.<br>As a computing undergraduate, the platform felt like a bridge between software craftsmanship and business impact, which made the work feel meaningful.</p><h3>Achievements so far</h3><p>Completing a substantial portion of the bootcamp Trailmix laid a base for admin concepts, platform navigation, and the discipline of incremental learning.<br>Sharing notes publicly and engaging with local events kept momentum alive even when schedules were heavy.​</p><h3>Motivation that lasts</h3><p>The long-term aim is to grow into a Salesforce developer who can design, extend, and integrate solutions across products and APIs with reliability.<br>Certifications are on the roadmap because they validate skills, provide structure, and open doors while keeping the learning loop honest.</p><h3>Challenges and lessons</h3><p>Academic deadlines and time management forced pauses, but they also taught that systems beat motivation — calendared study blocks, bite-sized goals, and accountability to the community.<br>The biggest lesson so far: progress is uneven, but consistency compounds when the focus is on the next small win.</p><h3>Gratitude to the community</h3><p>Huge thanks to the <a href="https://yarlsfo.org/">Yarl Salesforce Ohana</a> for creating inclusive programs, mentorship, and a culture that encourages beginners to become builders.​<br>Their events, bootcamps, and ongoing guidance continue to be the scaffolding behind this journey.​</p><h3>What to expect next in this series</h3><p>Future posts will share practical notes on admin foundations, Flow patterns, Apex basics, and integration stories — plus personal reflections on what worked and what did not.<br>The goal is to make every chapter useful for another beginner who is balancing studies, work, and curiosity for the platform.</p><ul><li>Trailblazer ID: <a href="https://www.salesforce.com/trailblazer/yoosufaathil">https://www.salesforce.com/trailblazer/yoosufaathil</a></li><li>LinkedIn: @yoosuf-aathil</li><li>X/Twitter: @AathilYoosuf</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd4afde07e00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dynamic Programming and Greedy Algorithms in Java — Mastering Optimization Techniques]]></title>
            <link>https://medium.com/@yoosufaath007/dynamic-programming-and-greedy-algorithms-in-java-mastering-optimization-techniques-c1b664e04a51?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1b664e04a51</guid>
            <category><![CDATA[knapsack-problem]]></category>
            <category><![CDATA[coin-change-algorithm]]></category>
            <category><![CDATA[dynamic-programming]]></category>
            <category><![CDATA[greedy-algorithms]]></category>
            <category><![CDATA[dsa-interview-questions]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Tue, 29 Jul 2025 12:06:01 GMT</pubDate>
            <atom:updated>2025-07-29T12:06:01.320Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dynamic Programming and Greedy Algorithms in Java — Mastering Optimization Techniques</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C09FWIoL1RgSePcxCNzFkw.png" /></figure><p>🚀 <strong>Welcome to the final part (Part 6) of our Data Structures and Algorithms (DSA) series!</strong> In this post, we’ll explore <strong>Dynamic Programming (DP)</strong> and <strong>Greedy Algorithms</strong>, two advanced algorithmic techniques that are essential for solving complex optimization problems.</p><p>We’ll cover</p><p>💡 <strong>What is Dynamic Programming?</strong> — Concepts and intuition.</p><p>🔑 <strong>Key DP Techniques</strong> — Memoization vs. Tabulation.</p><p>🧩 <strong>Classic DP Problems</strong> — Fibonacci, Knapsack, and more.</p><p>⚡ <strong>What is the Greedy Approach?</strong> — When and why it works.</p><p>📘 <strong>Java Implementations with Examples.</strong></p><p>🔥 <strong>Top Interview Questions on DP and Greedy Algorithms.</strong></p><p>By the end of this post, you’ll have a solid foundation in <strong>optimization techniques</strong> to tackle real-world problems and coding interviews.</p><h3>1. What is Dynamic Programming?</h3><p>Dynamic Programming is a problem-solving approach that breaks problems into <strong>overlapping subproblems</strong> and stores their results to avoid recomputation. It’s ideal for problems with <strong>optimal substructure</strong>.</p><h4>Characteristics of DP Problems</h4><p>🔹 <strong>Optimal Substructure:</strong> The solution can be constructed from solutions to subproblems.</p><p>🔹 <strong>Overlapping Subproblems:</strong> The same subproblems are solved multiple times.</p><h4>Real-world analogy</h4><p>Imagine climbing stairs — you can climb 1 or 2 steps at a time. Instead of recalculating ways from each step, store the results and reuse them.</p><h3>2. Memoization vs. Tabulation</h3><p>📝 <strong>Memoization (Top-Down):</strong> Solve the problem recursively and store results in a cache.</p><p>📊 <strong>Tabulation (Bottom-Up):</strong> Build the solution iteratively from the smallest subproblems.</p><h3>3. Classic DP Example — Fibonacci Sequence</h3><pre>// Top-Down (Memoization)<br>import java.util.HashMap;<br><br>class Fibonacci {<br>    private HashMap&lt;Integer, Integer&gt; memo = new HashMap&lt;&gt;();<br><br>    int fib(int n) {<br>        if (n &lt;= 1) return n;<br>        if (memo.containsKey(n)) return memo.get(n);<br>        int result = fib(n - 1) + fib(n - 2);<br>        memo.put(n, result);<br>        return result;<br>    }<br><br>    public static void main(String[] args) {<br>        Fibonacci f = new Fibonacci();<br>        System.out.println(f.fib(10)); // Output: 55<br>    }<br>}<br></pre><pre>// Bottom-Up (Tabulation)<br>class FibonacciTab {<br>    int fib(int n) {<br>        if (n &lt;= 1) return n;<br>        int[] dp = new int[n + 1];<br>        dp[0] = 0; dp[1] = 1;<br>        for (int i = 2; i &lt;= n; i++) {<br>            dp[i] = dp[i - 1] + dp[i - 2];<br>        }<br>        return dp[n];<br>    }<br><br>    public static void main(String[] args) {<br>        FibonacciTab f = new FibonacciTab();<br>        System.out.println(f.fib(10)); // Output: 55<br>    }<br>}</pre><h3>4. Knapsack Problem — A Popular DP Problem</h3><p><strong>Problem Statement:</strong> Given weights and values of items, find the maximum value you can carry in a knapsack of capacity W.</p><h4>Knapsack DP Solution</h4><pre>class Knapsack {<br>    int knapSack(int W, int wt[], int val[], int n) {<br>        int[][] dp = new int[n + 1][W + 1];<br><br>        for (int i = 0; i &lt;= n; i++) {<br>            for (int w = 0; w &lt;= W; w++) {<br>                if (i == 0 || w == 0)<br>                    dp[i][w] = 0;<br>                else if (wt[i - 1] &lt;= w)<br>                    dp[i][w] = Math.max(val[i - 1] + dp[i - 1][w - wt[i - 1]], dp[i - 1][w]);<br>                else<br>                    dp[i][w] = dp[i - 1][w];<br>            }<br>        }<br>        return dp[n][W];<br>    }<br><br>    public static void main(String[] args) {<br>        Knapsack ks = new Knapsack();<br>        int val[] = {60, 100, 120};<br>        int wt[] = {10, 20, 30};<br>        int W = 50;<br>        System.out.println(ks.knapSack(W, wt, val, val.length)); // Output: 220<br>    }<br>}</pre><h3>5. What is a Greedy Algorithm?</h3><p>A <strong>Greedy Algorithm</strong> builds a solution step by step by always choosing the <strong>locally optimal choice</strong>, hoping it leads to the global optimum.</p><h4>When does Greedy work?</h4><p>Greedy algorithms work for problems that exhibit</p><p>🔸 <strong>Greedy-choice property:</strong> A global optimum can be arrived at by selecting a local optimum.</p><p>🔸 <strong>Optimal substructure:</strong> A problem can be broken into subproblems.</p><h3>6. Greedy Algorithm Example — Coin Change</h3><pre>import java.util.Arrays;<br><br>class CoinChange {<br>    void findMinCoins(int coins[], int amount) {<br>        Arrays.sort(coins);<br>        int count = 0;<br>        for (int i = coins.length - 1; i &gt;= 0; i--) {<br>            while (amount &gt;= coins[i]) {<br>                amount -= coins[i];<br>                count++;<br>                System.out.print(coins[i] + &quot; &quot;);<br>            }<br>        }<br>        System.out.println(&quot;\nTotal Coins: &quot; + count);<br>    }<br><br>    public static void main(String[] args) {<br>        CoinChange cc = new CoinChange();<br>        int coins[] = {1, 2, 5, 10, 20, 50};<br>        cc.findMinCoins(coins, 93); // Example Output: 50 20 20 2 1<br>    }<br>}</pre><h3>7. Common Interview Questions on DP and Greedy</h3><p>🧠 <strong>Longest Common Subsequence (LCS).</strong></p><p>🧠 <strong>Edit Distance Problem.</strong></p><p>🧠 <strong>Minimum Number of Coins (Coin Change DP).</strong></p><p>🧠 <strong>Job Scheduling with Deadlines (Greedy).</strong></p><p>🧠 <strong>Activity Selection Problem (Greedy).</strong></p><p>Dynamic Programming and Greedy Algorithms are <strong>essential tools for optimizing solutions</strong>. While DP ensures accuracy by exploring all subproblems, Greedy offers faster solutions when applicable.</p><p>This concludes our <strong>6-part DSA series in Java</strong>! 🎉 You now have a strong foundation in <strong>arrays, linked lists, stacks, queues, trees, graphs, dynamic programming, and greedy techniques</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1b664e04a51" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Struggling with DSA? Here’s How I’m Learning]]></title>
            <link>https://blog.stackademic.com/struggling-with-dsa-heres-how-i-m-learning-c588edf2955f?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/c588edf2955f</guid>
            <category><![CDATA[coding-interview-prep]]></category>
            <category><![CDATA[beginner-friendly-tips]]></category>
            <category><![CDATA[leetcode-challenge]]></category>
            <category><![CDATA[dsa-learning-journey]]></category>
            <category><![CDATA[java-problem-solving]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Tue, 29 Jul 2025 07:18:43 GMT</pubDate>
            <atom:updated>2025-07-29T07:18:43.601Z</atom:updated>
            <content:encoded><![CDATA[<h3>Struggling with DSA? Here’s How I’m Learning Java &amp; LeetCode (Step by Step) — My Journey from Struggle to Small Wins</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gH9acnALi7LIfkQluUM1uA.png" /><figcaption>Coding Journey</figcaption></figure><h3>My Honest Starting Point</h3><p>When I first heard about <strong>Data Structures and Algorithms (DSA)</strong> during my degree, it felt like something abstract — complicated diagrams, confusing terms, and a whole lot of theory. I didn’t spend enough time understanding it, and the result was simple: I failed to build a proper foundation.</p><p>Back then, I didn’t know how important DSA would be in <strong>real-world problem-solving or technical interviews</strong>. But later, while exploring coding platforms and seeing interview questions, I realized <strong>DSA is everywhere.</strong> You can’t really escape it if you want to grow as a developer.</p><h3>The Real Turning Point</h3><p>I hit a point where I couldn’t solve even basic LeetCode problems. I felt stuck and frustrated. But instead of giving up, I decided to <strong>start fresh with a simple mindset</strong></p><p>✔️Learn one concept at a time.</p><p>✔️Write small programs in <strong>Java</strong>, which I already knew well.</p><p>✔️Treat every solved problem as a small win instead of chasing perfection.</p><p>This mindset shift was the biggest turning point for me.</p><h3>How I’m Learning DSA (Step by Step)</h3><h3>1. Interview Cake — Learning Problem-Solving Techniques</h3><p>I started with <a href="https://www.interviewcake.com/">Interview Cake</a>. What I liked the most is how they <strong>explain algorithms in plain English with practical examples.</strong> Instead of just throwing code at me, they guide me through <strong>how to think like an engineer.</strong></p><p>Even if some of their tips seem simple, they changed how I look at problems. I realized DSA isn’t about memorizing solutions — <strong>it’s about building a problem-solving mindset.</strong></p><h3>2. Udemy’s Java DSA Course</h3><p>I also follow the <strong>“</strong><a href="https://www.udemy.com/course/data-structures-and-algorithms-java/"><strong>Java Data Structures &amp; Algorithms + LeetCode Exercises</strong></a><strong>”</strong> course on Udemy. It breaks down each data structure — arrays, linked lists, trees, graphs — into <strong>clear, digestible lessons.</strong> Right after learning, I try solving similar problems on <a href="https://leetcode.com/"><strong>LeetCode </strong></a><strong>or </strong><a href="https://www.hackerrank.com/dashboard"><strong>HackerRank</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdkcGji9XFVu2yHLU1XGNg.png" /></figure><h3>For Those Who Can’t Afford Paid Resources</h3><p>I know not everyone can afford paid platforms like Udemy or Interview Cake. That’s why I want to share everything I’ve learned <strong>for free</strong> here on Medium — including</p><ul><li><strong>Step-by-step explanations of DSA concepts (in Java).</strong></li><li><strong>Simple real-world examples</strong> to make the concepts stick.</li><li><strong>Practice problems</strong> with my personal approach to solving them.</li></ul><p>My aim is to make DSA <strong>less scary and more approachable</strong> for beginners.</p><h3>The Struggles I Still Face</h3><p>I’m not a pro in DSA yet — I’m still learning. There are problems on LeetCode and Codeforces that I find tough, but that’s okay. What matters is that I can now solve <strong>basic to intermediate problems</strong> and, more importantly, <strong>I enjoy the process.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_8a6T2P4CG8MIEou-bTmg.png" /></figure><h3>Why I’m Sharing My Experience</h3><p>I’ve realized there are so many students and developers like me who <strong>hate DSA</strong> because it looks complicated at first. My goal with this Medium series is simple</p><ul><li>Show you that learning DSA step by step is <strong>possible</strong>.</li><li>Share my mistakes so you can avoid them.</li><li>Provide <strong>free, beginner-friendly explanations</strong> that you can actually understand and apply.</li></ul><h3>Small Steps Matter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vynj5aESn0Mk9rQI4fTXaA.png" /><figcaption>DSA Roadmap</figcaption></figure><p>DSA is not something you master overnight. It’s about <strong>taking one small step each day</strong> — solving a simple problem, understanding a new concept, and building confidence slowly. If you’re reading this and feel stuck with DSA, trust me, I’ve been there.</p><p>In my upcoming posts, I’ll cover the <strong>exact DSA concepts I’m learning</strong> and explain them in a <strong>storytelling style, with Java code examples and free problem-solving guides.</strong></p><p><strong>Follow my work</strong><br> <a href="https://github.com/YoosufAathil">GitHub</a> | <a href="https://www.linkedin.com/in/yoosuf-aathil/">LinkedIn</a> | <a href="https://x.com/AathilYoosuf">Twitter</a></p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏️<strong>️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/@InPlainEnglish"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a> | <a href="https://twitch.tv/inplainenglish"><strong>Twitch</strong></a></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c588edf2955f" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/struggling-with-dsa-heres-how-i-m-learning-c588edf2955f">Struggling with DSA? Here’s How I’m Learning</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Graphs and Graph Traversal Algorithms in Java — BFS and DFS Explained]]></title>
            <link>https://medium.com/@yoosufaath007/graphs-and-graph-traversal-algorithms-in-java-bfs-and-dfs-explained-f9d002ecb50f?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9d002ecb50f</guid>
            <category><![CDATA[graph-traversal]]></category>
            <category><![CDATA[adjacency-matrix]]></category>
            <category><![CDATA[graphs-in-java]]></category>
            <category><![CDATA[adjacency-list]]></category>
            <category><![CDATA[bfs-and-dfs-java]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Mon, 28 Jul 2025 12:02:06 GMT</pubDate>
            <atom:updated>2025-07-28T12:02:06.205Z</atom:updated>
            <content:encoded><![CDATA[<h3>Graphs and Graph Traversal Algorithms in Java — BFS and DFS Explained</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xlSkXYomzi3vipU_rrfGVw.png" /></figure><p>🌐 <strong>Welcome to Part 5 of our Data Structures and Algorithms (DSA) series!</strong> In this post, we’ll explore <strong>Graphs</strong>, one of the most powerful and versatile data structures in computer science. From <strong>Google Maps routing algorithms</strong> to <strong>social network connections</strong>, graphs are everywhere.</p><p>We will cover</p><p>🔍 <strong>What is a Graph?</strong> — Understanding vertices and edges.</p><p>🌟 <strong>Types of Graphs</strong> — Directed, undirected, weighted, and unweighted.</p><p>⚡ <strong>Graph Representations</strong> — Adjacency matrix vs. adjacency list.</p><p>🚀 <strong>Graph Traversal Algorithms</strong> — Breadth-First Search (BFS) and Depth-First Search (DFS).</p><p>💻 <strong>Java Implementations with Code Examples.</strong></p><p>🔥 <strong>Popular Interview Questions on Graphs.</strong></p><p>By the end of this post, you will know how to represent and traverse graphs efficiently using <strong>Java</strong>.</p><h3>1. What is a Graph?</h3><p>A <strong>graph</strong> is a set of <strong>nodes (vertices)</strong> connected by <strong>edges</strong>. It can represent relationships or connections between data points.</p><p><strong>Real-life analogy:</strong> Think of <strong>Google Maps</strong> — each location is a vertex, and the roads between them are edges.</p><h4>Key Terms</h4><p>🎯 <strong>Vertex (Node):</strong> Represents an object or location.</p><p>🔗 <strong>Edge:</strong> Represents a connection between two vertices.</p><p>⚖ <strong>Weight:</strong> Represents cost/distance (used in weighted graphs).</p><p>♾ <strong>Path:</strong> A sequence of connected vertices.</p><h3>2. Types of Graphs</h3><p>🌍 <strong>Undirected Graph:</strong> Edges have no direction (e.g., Facebook friend network).</p><p>🔄 <strong>Directed Graph (Digraph):</strong> Edges have direction (e.g., Twitter follow relationships).</p><p>⚖ <strong>Weighted Graph:</strong> Each edge has a weight or cost (e.g., Google Maps distances).</p><p>🚦 <strong>Unweighted Graph:</strong> All edges have equal cost.</p><p>♻ <strong>Cyclic &amp; Acyclic Graphs:</strong> Cyclic graphs have loops; acyclic graphs don’t.</p><h3>3. Graph Representation in Java</h3><p>Graphs are typically represented using</p><p>🧮 <strong>Adjacency Matrix:</strong> A 2D array where matrix[i][j] indicates an edge between vertex i and j.</p><p>📝 <strong>Adjacency List:</strong> A list of lists where each vertex has a list of its neighbors.</p><h4>Adjacency List Example in Java</h4><pre>import java.util.*;<br><br>class Graph {<br>    private int vertices;<br>    private LinkedList&lt;Integer&gt; adjList[];<br><br>    Graph(int v) {<br>        vertices = v;<br>        adjList = new LinkedList[v];<br>        for (int i = 0; i &lt; v; ++i)<br>            adjList[i] = new LinkedList&lt;&gt;();<br>    }<br><br>    void addEdge(int v, int w) {<br>        adjList[v].add(w);<br>    }<br><br>    void printGraph() {<br>        for (int i = 0; i &lt; vertices; i++) {<br>            System.out.print(&quot;Vertex &quot; + i + &quot;:&quot;);<br>            for (Integer node : adjList[i]) {<br>                System.out.print(&quot; -&gt; &quot; + node);<br>            }<br>            System.out.println();<br>        }<br>    }<br>}<br><br>public class GraphDemo {<br>    public static void main(String[] args) {<br>        Graph g = new Graph(5);<br>        g.addEdge(0, 1);<br>        g.addEdge(0, 4);<br>        g.addEdge(1, 2);<br>        g.addEdge(1, 3);<br>        g.addEdge(1, 4);<br>        g.printGraph();<br>    }<br>}</pre><h3>4. Breadth-First Search (BFS)</h3><p><strong>BFS</strong> is a graph traversal algorithm that explores vertices level by level using a <strong>queue</strong>.</p><h4>BFS Algorithm Steps</h4><p>🔹 Start from a source vertex.</p><p>🔹 Visit all its neighbors.</p><p>🔹 Use a queue to keep track of unvisited vertices.</p><h4>BFS Java Implementation</h4><pre>void BFS(int start) {<br>    boolean visited[] = new boolean[vertices];<br>    Queue&lt;Integer&gt; queue = new LinkedList&lt;&gt;();<br><br>    visited[start] = true;<br>    queue.add(start);<br><br>    while (!queue.isEmpty()) {<br>        int node = queue.poll();<br>        System.out.print(node + &quot; &quot;);<br><br>        for (int neighbor : adjList[node]) {<br>            if (!visited[neighbor]) {<br>                visited[neighbor] = true;<br>                queue.add(neighbor);<br>            }<br>        }<br>    }<br>}</pre><h3>5. Depth-First Search (DFS)</h3><p><strong>DFS</strong> explores as far as possible along one branch before backtracking. It can be implemented using <strong>recursion or a stack</strong>.</p><h4>DFS Java Implementation</h4><pre>void DFSUtil(int v, boolean visited[]) {<br>    visited[v] = true;<br>    System.out.print(v + &quot; &quot;);<br><br>    for (int neighbor : adjList[v]) {<br>        if (!visited[neighbor])<br>            DFSUtil(neighbor, visited);<br>    }<br>}<br><br>void DFS(int start) {<br>    boolean visited[] = new boolean[vertices];<br>    DFSUtil(start, visited);<br>}</pre><h3>6. Time Complexity of Graph Operations</h3><ul><li><strong>BFS:</strong> O(V + E) where V = number of vertices, E = number of edges.</li><li><strong>DFS:</strong> O(V + E).</li><li><strong>Space Complexity:</strong> O(V) due to the visited array.</li></ul><h3>7. Common Interview Questions on Graphs</h3><p>🔥 <strong>Detect cycles in a graph (DFS-based).</strong></p><p>🔥 <strong>Find shortest path using BFS.</strong></p><p>🔥 <strong>Implement Dijkstra’s Algorithm (weighted graph).</strong></p><p>🔥 <strong>Check if a graph is bipartite.</strong></p><p>🔥 <strong>Count connected components.</strong></p><p>Graphs are a <strong>powerful data structure</strong> that models complex relationships. Understanding <strong>BFS and DFS in Java</strong> will help you solve real-world problems like network routing, web crawling, and pathfinding.</p><p>In the <strong>next post (Part 6)</strong>, we’ll dive into <strong>Dynamic Programming and Greedy Algorithms</strong> — the final part of this series!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9d002ecb50f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trees and Binary Search Trees (BSTs) in Java — Understanding Hierarchical Data Structures]]></title>
            <link>https://medium.com/@yoosufaath007/trees-and-binary-search-trees-bsts-in-java-understanding-hierarchical-data-structures-3e41c650ec90?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e41c650ec90</guid>
            <category><![CDATA[trees-in-java]]></category>
            <category><![CDATA[bst-tutorial]]></category>
            <category><![CDATA[hierarchical]]></category>
            <category><![CDATA[dsa-interview-prep]]></category>
            <category><![CDATA[java-tree-traversal]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 19:12:33 GMT</pubDate>
            <atom:updated>2025-07-27T07:45:27.725Z</atom:updated>
            <content:encoded><![CDATA[<h3>Trees and Binary Search Trees (BSTs) in Java — Understanding Hierarchical Data Structures</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ApUciGwbWG9ZmbiMNL5LCQ.png" /></figure><p>🌳 <strong>Welcome to Part 4 of our Data Structures and Algorithms (DSA) series!</strong> In this post, we’ll dive into <strong>Trees</strong> and <strong>Binary Search Trees (BSTs)</strong> using <strong>Java</strong>. Trees are among the most versatile and widely used data structures in computer science, powering everything from databases and file systems to AI and compilers.</p><p>We’ll explore:</p><ul><li>🌱 What are Trees and their real-world analogies.</li><li>🌳 Types of Trees and their applications.</li><li>🌲 Binary Trees vs. Binary Search Trees.</li><li>✨ Common operations like insertion, deletion, and traversal.</li><li>💡 Java implementations with examples.</li><li>🔥 Popular interview questions on Trees.</li></ul><p>By the end of this post, you’ll not only understand how Trees and BSTs work but also know how to code them confidently.</p><h3>1. What is a Tree Data Structure?</h3><p>A <strong>Tree</strong> is a hierarchical data structure consisting of <strong>nodes</strong>. The topmost node is called the <strong>root</strong>, and nodes can have <strong>children</strong>.</p><p><strong>Real-life analogy:</strong> Imagine a <strong>family tree</strong> — one ancestor (root), their children (nodes), grandchildren, and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*RcKGHVYVCYOFQEJxFttk5Q.png" /></figure><h4>Key Terms:</h4><ul><li>🌟 <strong>Root Node:</strong> The first node of the tree.</li><li>🌿 <strong>Parent and Child Nodes:</strong> Nodes connected downward.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*1IHk18h9KVFAJAJAiZyQug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*uJ4mbu9hzCzE5Vx0kjZI3Q.png" /></figure><ul><li>🍂 <strong>Leaf Nodes:</strong> Nodes without children.</li><li>🛤 <strong>Path:</strong> A sequence of nodes connecting two points.</li></ul><h3>2. Types of Trees</h3><p>🌴 <strong>General Tree:</strong> Each node can have multiple children.</p><p>🌲 <strong>Binary Tree:</strong> Each node has at most two children (left and right).</p><p>🌳 <strong>Binary Search Tree (BST):</strong> A binary tree where the left subtree contains values less than the root and the right subtree contains values greater than the root.</p><p>🌵 <strong>Balanced Trees (AVL, Red-Black):</strong> Trees that keep height balanced for efficiency.</p><h3>3. Why Use Trees?</h3><p>Trees are used when <strong>hierarchical relationships</strong> need to be represented. They power</p><p>📂 <strong>File Systems</strong> (folders and subfolders).</p><p>📚 <strong>Databases</strong> (indexes and B-trees).</p><p>🗺 <strong>Navigation Systems</strong> (finding shortest paths).</p><p>🤖 <strong>AI algorithms</strong> (decision trees, game trees).</p><h3>4. Binary Search Tree (BST)</h3><p>A <strong>BST</strong> is a special kind of binary tree that allows <strong>fast search, insertion, and deletion</strong>.</p><h4>Properties of BST</h4><p>🌟 Left child &lt; Parent node.</p><p>🌟 Right child &gt; Parent node.</p><p>🌟 No duplicate values.</p><h4>Why BSTs?</h4><p>They allow <strong>O(log n)</strong> search in the average case, which is much faster than arrays (O(n)).</p><h3>5. Implementing a BST in Java</h3><pre>class Node {<br>    int key;<br>    Node left, right;<br><br>    public Node(int item) {<br>        key = item;<br>        left = right = null;<br>    }<br>}<br><br>class BinarySearchTree {<br>    Node root;<br><br>    BinarySearchTree() { root = null; }<br><br>    void insert(int key) {<br>        root = insertRec(root, key);<br>    }<br><br>    Node insertRec(Node root, int key) {<br>        if (root == null) {<br>            root = new Node(key);<br>            return root;<br>        }<br>        if (key &lt; root.key)<br>            root.left = insertRec(root.left, key);<br>        else if (key &gt; root.key)<br>            root.right = insertRec(root.right, key);<br>        return root;<br>    }<br><br>    void inorder() {<br>        inorderRec(root);<br>    }<br><br>    void inorderRec(Node root) {<br>        if (root != null) {<br>            inorderRec(root.left);<br>            System.out.print(root.key + &quot; &quot;);<br>            inorderRec(root.right);<br>        }<br>    }<br><br>    public static void main(String[] args) {<br>        BinarySearchTree bst = new BinarySearchTree();<br>        bst.insert(50);<br>        bst.insert(30);<br>        bst.insert(70);<br>        bst.insert(20);<br>        bst.insert(40);<br>        bst.insert(60);<br>        bst.insert(80);<br><br>        System.out.print(&quot;Inorder Traversal: &quot;);<br>        bst.inorder();<br>    }<br>}</pre><h3>6. Tree Traversal Methods</h3><p>Traversals are ways to visit all nodes in a tree</p><p>🔁 <strong>Inorder (Left, Root, Right):</strong> Sorted order in BSTs.</p><p>🔁 <strong>Preorder (Root, Left, Right):</strong> Used to create tree copies.</p><p>🔁 <strong>Postorder (Left, Right, Root):</strong> Useful for deleting trees.</p><p>🔁 <strong>Level-order Traversal:</strong> Uses a queue (BFS).</p><h3>7. Interview Questions on Trees</h3><p>🤔 <strong>Find the height of a binary tree.</strong></p><p>🤔 <strong>Check if a tree is balanced.</strong></p><p>🤔 <strong>Lowest Common Ancestor (LCA) of two nodes.</strong></p><p>🤔 <strong>Convert a BST to a sorted doubly linked list.</strong></p><p>🤔 <strong>Serialize and Deserialize a Binary Tree.</strong></p><p>Trees and BSTs are <strong>fundamental data structures</strong> that you’ll encounter often in coding interviews and real-world applications. Understanding <strong>insertion, search, and traversal</strong> operations will give you an edge in solving hierarchical data problems.</p><p>In our <strong>next post (Part 5)</strong>, we’ll dive into <strong>Graphs and Traversal Algorithms (BFS and DFS)</strong>. Stay tuned! 🌟</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e41c650ec90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linked Lists, Stacks, and Queues in Java — Data Structures & Algorithms Explained]]></title>
            <link>https://medium.com/@yoosufaath007/linked-lists-stacks-and-queues-in-java-data-structures-algorithms-explained-139e5165fda3?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/139e5165fda3</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[datastrucutre]]></category>
            <category><![CDATA[stacks-queues]]></category>
            <category><![CDATA[linkedlist-in-java]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 14:01:56 GMT</pubDate>
            <atom:updated>2025-07-26T14:01:56.369Z</atom:updated>
            <content:encoded><![CDATA[<h3>Linked Lists, Stacks, and Queues in Java — Data Structures &amp; Algorithms Explained</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOk91BE_1Kz4bVWbzfsmmA.png" /><figcaption>Data structure and Algorithms — Part 03</figcaption></figure><p>Welcome to the third post of our <strong>Data Structures and Algorithms (DSA) series</strong>! In this article, we explore <strong>Linked Lists, Stacks, and Queues</strong> using <strong>Java</strong>. These linear data structures form the foundation of many advanced algorithms and interview questions. Mastering these concepts is crucial for anyone aiming to excel in <strong>Java programming, competitive coding, or technical interviews</strong>.</p><h3>1. Linked Lists in Java</h3><h4>What is a Linked List?</h4><p>A <strong>linked list</strong> is a sequence of nodes where each node contains <strong>data</strong> and a reference (<strong>pointer</strong>) to the next node. Unlike arrays, linked lists provide <strong>dynamic memory allocation</strong> and efficient insertions/deletions.</p><figure><img alt="Representation of a LinkedList" src="https://cdn-images-1.medium.com/max/921/1*Sqa6kjDveVPfiMV_twqVQQ.png" /><figcaption>Visual Representation of a Linked List</figcaption></figure><h4>Advantages of Linked Lists</h4><p>✅ <strong>Dynamic size</strong> (no need to define length at creation)</p><p>✅ <strong>Efficient insertion and deletion</strong> (O(1) when inserting at the head)</p><p>✅ <strong>No memory wastage</strong></p><h4>Disadvantages</h4><p>✅ <strong>Sequential access only</strong> (O(n) to access an element)</p><p>✅ <strong>More memory</strong> (requires storing pointers)</p><h4>Implementation of a Singly Linked List in Java</h4><pre>class Node {<br>    int data;<br>    Node next;<br>    Node(int data) {<br>        this.data = data;<br>        this.next = null;<br>    }<br>}<br><br>public class LinkedList {<br>    Node head;<br><br>    public void insert(int data) {<br>        Node newNode = new Node(data);<br>        if (head == null) {<br>            head = newNode;<br>        } else {<br>            Node temp = head;<br>            while (temp.next != null) {<br>                temp = temp.next;<br>            }<br>            temp.next = newNode;<br>        }<br>    }<br><br>    public void display() {<br>        Node current = head;<br>        while (current != null) {<br>            System.out.print(current.data + &quot; -&gt; &quot;);<br>            current = current.next;<br>        }<br>        System.out.println(&quot;null&quot;);<br>    }<br><br>    public static void main(String[] args) {<br>        LinkedList list = new LinkedList();<br>        list.insert(10);<br>        list.insert(20);<br>        list.insert(30);<br>        list.display(); // Output: 10 -&gt; 20 -&gt; 30 -&gt; null<br>    }<br>}</pre><h4>Time Complexity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*Fe9CPhdci2c82w55WmjIIw.png" /><figcaption>Common operations in Linked List vs Time complexity</figcaption></figure><h3>2. Stacks in Java</h3><h4>What is a Stack?</h4><p>A <strong>stack</strong> is a linear data structure that follows the <strong>LIFO (Last In, First Out)</strong> principle. Imagine a stack of plates — you can only add or remove the top plate.</p><h4>Stack Operations:</h4><p>✅ <strong>push(x):</strong> Insert an element at the top.</p><p>✅ <strong>pop():</strong> Remove the top element.</p><p>✅ <strong>peek():</strong> View the top element.</p><p>✅ <strong>isEmpty():</strong> Check if the stack is empty.</p><h4>Stack Implementation in Java (Using Stack Class)</h4><pre>import java.util.Stack;<br><br>public class StackExample {<br>    public static void main(String[] args) {<br>        Stack&lt;Integer&gt; stack = new Stack&lt;&gt;();<br><br>        stack.push(10);<br>        stack.push(20);<br>        stack.push(30);<br><br>        System.out.println(&quot;Top Element: &quot; + stack.peek()); // Output: 30<br>        stack.pop();<br>        System.out.println(&quot;After pop: &quot; + stack);<br>    }<br>}</pre><h4>Time Complexity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/217/1*9m4yZ0R3zaJ9z6JGtkttOw.png" /><figcaption>Common operations in stack vs Time complexity</figcaption></figure><h3>3. Queues in Java</h3><h4>What is a Queue?</h4><p>A <strong>queue</strong> is a linear data structure that follows the <strong>FIFO (First In, First Out)</strong> principle — like people standing in line at a ticket counter.</p><h4>Queue Operations</h4><p>✅ <strong>enqueue(x):</strong> Insert an element at the rear.</p><p>✅ <strong>dequeue():</strong> Remove the front element.</p><p>✅ <strong>peek():</strong> View the front element.</p><p>✅ <strong>isEmpty():</strong> Check if the queue is empty.</p><h4>Queue Implementation in Java (Using LinkedList)</h4><pre>import java.util.LinkedList;<br>import java.util.Queue;<br><br>public class QueueExample {<br>    public static void main(String[] args) {<br>        Queue&lt;Integer&gt; queue = new LinkedList&lt;&gt;();<br><br>        queue.add(10);<br>        queue.add(20);<br>        queue.add(30);<br><br>        System.out.println(&quot;Front Element: &quot; + queue.peek()); // Output: 10<br>        queue.remove();<br>        System.out.println(&quot;After dequeue: &quot; + queue);<br>    }<br>}</pre><h4>Time Complexity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/1*uQkR45EOkd5H_exltM7Hbg.png" /><figcaption>Common operations in Queue vs Time complexity</figcaption></figure><h3>4. Interview Questions on Linked Lists, Stacks, and Queues</h3><p>✔️ <strong>Reverse a Linked List</strong> (Iterative and Recursive approaches)</p><p>✔️ <strong>Check for Balanced Parentheses</strong> (using a stack)</p><p>✔️ <strong>Implement Queue using Two Stacks</strong></p><p>✔️ <strong>Find the Middle of a Linked List</strong></p><p>✔️ <strong>LRU Cache</strong> (combining hash tables with queues)</p><p>Linked Lists, Stacks, and Queues are core <strong>data structures in Java</strong> that form the building blocks for advanced algorithms. Stacks handle <strong>backtracking problems</strong>, while queues power <strong>scheduling and BFS algorithms</strong>.</p><p>In the next article of our <strong>DSA in Java series</strong>, we’ll dive deep into <strong>Trees and Binary Search Trees</strong> — stay tuned! If you found this post helpful, share it with your network and leave a comment with your favorite <strong>stack or queue interview question</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=139e5165fda3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arrays and Hash Tables in Java — Mastering Data Structures & Algorithms]]></title>
            <link>https://medium.com/@yoosufaath007/arrays-and-hash-tables-in-java-mastering-data-structures-algorithms-73741bf5293a?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/73741bf5293a</guid>
            <category><![CDATA[dsa-courses]]></category>
            <category><![CDATA[datastrucutre]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Fri, 25 Jul 2025 12:33:24 GMT</pubDate>
            <atom:updated>2025-07-25T12:33:24.165Z</atom:updated>
            <content:encoded><![CDATA[<h3>Arrays and Hash Tables in Java — Mastering Data Structures &amp; Algorithms</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vn8eN7YwmkT1nUOYuiSA2g.png" /><figcaption>Mastering Data Structures &amp; Algorithms Part -02</figcaption></figure><p>In this part of our <strong>Data Structures and Algorithms (DSA) series</strong>, we dive into two fundamental data structures: <strong>Arrays</strong> and <strong>Hash Tables</strong>. Mastering these structures is essential for <strong>Java developers</strong>, competitive programmers, and those preparing for <strong>coding interviews</strong> at top tech companies like Google, Amazon, and Microsoft.</p><p>By the end of this guide, you will understand how <strong>arrays and hash tables work</strong>, their advantages and limitations, and how to implement them in <strong>Java</strong> with optimized code.</p><h3>1. Understanding Arrays in Java</h3><h4>What is an Array?</h4><p>An <strong>array</strong> is a collection of elements stored in contiguous memory locations. It allows fast <strong>random access</strong> to elements using an index but has a <strong>fixed size</strong>.</p><h4>Key Properties of Arrays</h4><p>· <strong>Constant-time access</strong> (O(1) for retrieval by index)</p><p>· <strong>Fixed size</strong> (must define the length at initialization)</p><p>· <strong>Efficient memory utilization</strong></p><p>· <strong>Inefficient insertions and deletions</strong> (O(n) in the worst case)</p><h4>Declaring and Initializing an Array in Java</h4><pre>// Declaration and Initialization<br>int[] numbers = new int[5]; // Array of size 5<br>int[] values = {10, 20, 30, 40, 50}; // Direct initialization</pre><h4>Accessing and Modifying Array Elements</h4><pre>// Accessing Elements<br>System.out.println(values[2]); // Output: 30<br><br>// Modifying Elements<br>values[2] = 99; // Changing 30 to 99</pre><h4>Array Traversal</h4><pre>// Using a for loop<br>for (int i = 0; i &lt; values.length; i++) {<br>    System.out.println(values[i]);<br>}<br><br>// Using an enhanced for loop<br>for (int num : values) {<br>    System.out.println(num);<br>}</pre><h4>Common Array Operations and Time Complexity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*jbdp90F9UPjINuLgEn8sEQ.png" /><figcaption>common array operations vs time complexity</figcaption></figure><h3>2. Understanding Hash Tables in Java</h3><h4>What is a Hash Table?</h4><p>A <strong>hash table (or hash map)</strong> is a data structure that stores key-value pairs. It provides <strong>fast lookup, insertion, and deletion</strong> using a <strong>hash function</strong>.</p><h4>Advantages of Hash Tables</h4><p>· <strong>Fast lookups</strong> (O(1) on average case)</p><p>· <strong>Efficient insertions and deletions</strong></p><p>· <strong>Flexible key-value mappings</strong></p><h4>Hash Tables in Java (Using HashMap)</h4><p>Java provides a built-in <strong>HashMap</strong> class to implement hash tables efficiently.</p><h4>Declaring and Using a HashMap</h4><pre>import java.util.HashMap;<br><br>public class HashTableExample {<br>    public static void main(String[] args) {<br>        HashMap&lt;String, Integer&gt; studentScores = new HashMap&lt;&gt;();<br><br>        // Adding Key-Value Pairs<br>        studentScores.put(&quot;Alice&quot;, 85);<br>        studentScores.put(&quot;Bob&quot;, 90);<br>        studentScores.put(&quot;Charlie&quot;, 78);<br><br>        // Accessing Values<br>        System.out.println(&quot;Bob&#39;s Score: &quot; + studentScores.get(&quot;Bob&quot;)); // Output: 90<br><br>        // Checking Key Existence<br>        System.out.println(&quot;Contains Alice? &quot; + studentScores.containsKey(&quot;Alice&quot;)); // Output: true<br><br>        // Iterating Over a HashMap<br>        for (String key : studentScores.keySet()) {<br>            System.out.println(key + &quot; -&gt; &quot; + studentScores.get(key));<br>        }<br>    }<br>}</pre><h4>Hash Table Operations and Time Complexity</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*SkapEVGbqqW37ITYsSkRaA.png" /><figcaption>Hash Table operations vs Time complexity</figcaption></figure><h3>3. When to Use Arrays vs. Hash Tables?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*-F_Q83BCIjbOvNMuB7cfvw.png" /><figcaption>Arrays vs Hash Tables</figcaption></figure><blockquote><strong>Use Arrays when</strong></blockquote><blockquote>👉 You need <strong>fast indexed access</strong></blockquote><blockquote>👉 The number of elements is <strong>fixed</strong></blockquote><blockquote><strong>Use Hash Tables when</strong></blockquote><blockquote>👉 You need <strong>fast lookups by key</strong></blockquote><blockquote>👉 The dataset size is <strong>dynamic</strong></blockquote><h3>4. Interview Questions on Arrays and Hash Tables</h3><p>To prepare for <strong>coding interviews</strong>, try solving these questions on <strong>LeetCode</strong> or <strong>HackerRank</strong>:</p><p>1. <strong>Two Sum</strong> — Given an array, find two numbers that add up to a target sum.</p><p>2. <strong>Longest Consecutive Sequence</strong> — Find the longest sequence of consecutive elements in an unsorted array.</p><p>3. <strong>Valid Anagram</strong> — Check if two strings are anagrams using a hash table.</p><p>4. <strong>Subarray Sum Equals K</strong> — Find the number of subarrays that sum up to K.</p><p>Arrays and Hash Tables are fundamental in <strong>data structures and algorithms</strong>. Arrays offer <strong>fast access but inefficient insertions</strong>, while hash tables provide <strong>quick lookups but require more memory</strong>. Mastering these concepts is crucial for <strong>Java developers</strong> preparing for <strong>technical interviews</strong> and real-world software development.</p><p>In the next post, we will explore <strong>Linked Lists, Stacks, and Queues in Java</strong>. Stay tuned! 🚀</p><p>If you found this helpful, share it and follow for more <strong>DSA</strong> content. Let’s level up together! 💡</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73741bf5293a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Data Structures & Algorithms: Why Are They Important and How Do I Learn Them]]></title>
            <link>https://medium.com/@yoosufaath007/introduction-to-data-structures-algorithms-why-are-they-important-and-how-do-i-learn-them-20b25d364f84?source=rss-f3da0b854eb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/20b25d364f84</guid>
            <category><![CDATA[time-complexity]]></category>
            <category><![CDATA[big-o-notation]]></category>
            <category><![CDATA[dsa-courses]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[data-structures]]></category>
            <dc:creator><![CDATA[Aathil Yoosuf]]></dc:creator>
            <pubDate>Tue, 04 Mar 2025 13:41:44 GMT</pubDate>
            <atom:updated>2025-03-08T04:50:53.714Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DrlL8c0LNTvXq5YyR3uHcw.png" /><figcaption>Introduction to Data Structures and Algorithms Part -01</figcaption></figure><p>You’re officially here for my Data Structures &amp; Algorithms (DSA) series’ very first post! You’re either a newbie or simply looking to brush up on the fundamentals — this series breaks down tricky topics into easy, bite-sized concepts that aren’t boring and robotic at all!</p><h3><strong>Why Should You Care About DSA?</strong></h3><p>Suppose you are developing a food ordering application. Your system must<br>✅ Store millions of user locations efficiently.<br>✅ Specify the shortest delivery route in milliseconds.<br>✅ Process thousands of new orders simultaneously.</p><p>If it weren’t for efficient data structures and algorithms, your program would be unbearably slow and unresponsive. DSA is the foundation of problem-solving in computer programming, which makes code quicker, cleaner, and scalable.</p><h3>What’s in This Series?</h3><p>1️⃣ The Fundamentals: Learn time complexity and Big O notation.</p><p>2️⃣ Arrays &amp; Hash Tables: Storing and accessing data efficiently.</p><p>3️⃣ Linked Lists, Stacks, &amp; Queues: Organizing ordered data.</p><p>4️⃣ Trees &amp; Graphs: Traversing intricate relationships.</p><p>5️⃣ Sorting &amp; Searching Algorithms: Optimizing performance.</p><p>6️⃣ Dynamic Programming &amp; Greedy Algorithms: Challenging problem-solving.</p><p>Every post will have real-world analogies, code snippets, and interactive exercises for reinforcing learning.</p><p><strong>Time Complexity </strong><br>Prior to jumping into data structures, we must learn time complexity since it tells us how efficient an algorithm is.</p><p>Assume you have a list of 10 names and you want to locate “John” <br>You Can,</p><ul><li>Check one by one (<em>O(n) — Linear Search</em>).</li><li>Sort the list and perform a binary search (O(log n)).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*o1gsG8xHrwfrkD36wI-YZQ.png" /><figcaption>figure I — complexities comparison</figcaption></figure><p>It’s like looking for a page in a book</p><ul><li>Linear Search: Turn each page.</li><li>Binary Search: Open in the middle, discard half, repeat</li></ul><p>💡 Try It Yourself !</p><p>📝 <em>Challenge:</em> Write a function to find a number in an unsorted Array. Try both linear and binary search!</p><pre>function linearSearch(arr, target) {<br>    for (let i = 0; i &lt; arr.length; i++) {<br>        if (arr[i] === target) return i;<br>    }<br>    return -1;<br>}<br><br>function binarySearch(arr, target) {<br>    let left = 0, right = arr.length - 1;<br>    while (left &lt;= right) {<br>        let mid = Math.floor((left + right) / 2);<br>        if (arr[mid] === target) return mid;<br>        target &lt; arr[mid] ? right = mid - 1 : left = mid + 1;<br>    }<br>    return -1;<br>}</pre><p>🔗 Need to practice more?<em> </em>Go to <a href="https://leetcode.com/">LeetCode</a> for search problems!</p><h3>What’s Next?</h3><p>Next time, we’ll be examining Arrays and Hash Tables — how they function and where to implement them. Stay Tuned!</p><p>💬 <em>What is your greatest challenge with DSA? Don’t Forget to Comment below!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20b25d364f84" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>