<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mibhur Mahajan</title>
    <description>The latest articles on DEV Community by Mibhur Mahajan (@mhjnmibhur05).</description>
    <link>https://dev.to/mhjnmibhur05</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4027744%2F0b78ade3-e6b0-4b11-8d7f-c418b2cf3d0e.jpg</url>
      <title>DEV Community: Mibhur Mahajan</title>
      <link>https://dev.to/mhjnmibhur05</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mhjnmibhur05"/>
    <language>en</language>
    <item>
      <title>Day 1 of My DSA Journey: From Flowcharts to My First Java Code (And an Elegant Math Trick!)</title>
      <dc:creator>Mibhur Mahajan</dc:creator>
      <pubDate>Mon, 13 Jul 2026 20:57:35 +0000</pubDate>
      <link>https://dev.to/mhjnmibhur05/day-1-of-my-dsa-journey-from-flowcharts-to-my-first-java-code-and-an-elegant-math-trick-5hd1</link>
      <guid>https://dev.to/mhjnmibhur05/day-1-of-my-dsa-journey-from-flowcharts-to-my-first-java-code-and-an-elegant-math-trick-5hd1</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F31by2jwt71q7xhjippcs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F31by2jwt71q7xhjippcs.png" alt=" " width="800" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The journey of a thousand miles begins with a single step — or in the case of a Computer Science student, a single line of code.&lt;/p&gt;

&lt;p&gt;I’ve officially kicked off my Data Structures and Algorithms (DSA) public learning journey by diving into Kunal Kushwaha’s famous Java playlist. Going into Lecture 1, I thought I’d be immediately overwhelmed by complex Java syntax. Instead, I spent the first half of my day drawing shapes and the second half uncovering why Java is such a powerhouse language.&lt;/p&gt;

&lt;p&gt;Here is everything I learned on Day 1, including a brilliant prime-number optimization trick that absolutely blew my mind.&lt;/p&gt;

&lt;p&gt;Part 1: Thinking in Pictures (Flowcharts &amp;amp; Pseudocode)&lt;br&gt;
Before you write code for a computer, you have to clear up the logic in your own head. That’s where Flowcharts (visual maps) and Pseudocode (writing logic in plain English) come in.&lt;/p&gt;

&lt;p&gt;I started by learning the core toolkit of flowchart building blocks:&lt;/p&gt;

&lt;p&gt;🛑 Oval: Start / Stop&lt;br&gt;
📥 Parallelogram: Input / Output (getting data or displaying it)&lt;br&gt;
⚙️ Rectangle: Processing (doing calculations like math operations)&lt;br&gt;
💎 Diamond: Conditions (asking True/False questions to split the logic path)&lt;br&gt;
Warming Up with Simple Logic&lt;br&gt;
To get comfortable, I mapped out a few fundamental problems:&lt;/p&gt;

&lt;p&gt;The Hello Name Flowchart: A simple flow that takes a name as an input and outputs "Hello {Name}".&lt;br&gt;
The Salary Bonus Problem: A slightly more advanced flow with a condition. If a user inputs a salary greater than 10,000, they get a 2,000 bonus. Otherwise, they only get a 1,000 bonus.&lt;br&gt;
Visualizing the path of execution using these arrows makes it incredibly obvious how data moves through a program.&lt;/p&gt;

&lt;p&gt;🛑 The “Aha!” Moment: Optimizing the Prime Number Problem&lt;br&gt;
Things got real when I tried to design a flowchart and pseudocode to check if a number is Prime or not.&lt;/p&gt;

&lt;p&gt;The standard approach is straightforward: you start a counter at $c = 2$ and check if the number can be divided perfectly (num % c == 0). If it can, it's not prime. If it can't, you increment $c$ by 1 (c = c + 1) and loop back, checking every single number all the way up to num - 1.&lt;/p&gt;

&lt;p&gt;The Problem? It’s slow. Very slow for large numbers.&lt;br&gt;
But then came the optimization insight that made everything click. Let’s look at the factors of the number 36:&lt;/p&gt;

&lt;p&gt;1 * 36 = 36&lt;br&gt;
2 * 18 = 36&lt;br&gt;
3 * 12 = 36&lt;br&gt;
4 * 9 = 36&lt;br&gt;
6 * 6 = 36&lt;br&gt;
— — — — — — — — — (The Mirror Line)&lt;br&gt;
9 * 4 = 36 (Ignore! We already checked 4 x 9)&lt;br&gt;
12 * 3 = 36 (Ignore!)&lt;br&gt;
18 * 2 = 36 (Ignore!)&lt;br&gt;
Notice how past 6 times 6(the square root of 36), the factors just repeat themselves in reverse order? This means we don’t have to check all the way to the end!&lt;br&gt;
By changing our loop condition from while c &amp;lt; num to while c * c &amp;lt;= num (checking only up to the square root of the number), we drastically reduce the work the computer has to do. For a number like 17, instead of checking up to 16, we only check 2, 3, and 4. That is pure efficiency!&lt;/p&gt;

&lt;p&gt;Part 2: What Happens Under the Hood of Java?&lt;br&gt;
After conquering the logic, it was time to understand how Java actually talks to our computers. I mapped out the entire execution pipeline in my notes:&lt;/p&gt;

&lt;p&gt;SOURCE CODE — —COMPILER — → BYTE CODE(.CLASS FILE) — — INTERPRETER— → MACHINE CODE (0 &amp;amp; 1)&lt;/p&gt;

&lt;p&gt;The Secret to Java’s Superpower: Platform Independence&lt;br&gt;
If you write code in C or C++, the compiler converts it into an .exe file tailored specifically to your computer's architecture. That makes C/C++ platform-dependent.&lt;/p&gt;

&lt;p&gt;Java does things differently. The Java compiler converts your code into Bytecode (a .class file). This bytecode doesn't care what operating system you are using. Any computer with a Java Virtual Machine (JVM) can read it.&lt;/p&gt;

&lt;p&gt;💡 Key Takeaway: Java as a language is platform-independent because its bytecode can run anywhere, but the JVM itself is platform-dependent because it must be custom-built for Windows, Mac, or Linux to translate that bytecode into native machine code.&lt;/p&gt;

&lt;p&gt;Part 3: Writing My First Java Program!&lt;br&gt;
To wrap up Day 1, I finally opened the IDE and wrote the classic starter code:&lt;/p&gt;

&lt;p&gt;Java&lt;/p&gt;

&lt;p&gt;public class Main {&lt;br&gt;
    public static void main(String[] args) {&lt;br&gt;
        System.out.println("Hello World!");&lt;br&gt;
    }&lt;br&gt;
}&lt;br&gt;
A Quick Trick I Learned About Strings&lt;br&gt;
While learning about data inputs, I noted two crucial details that often trip up beginners:&lt;/p&gt;

&lt;p&gt;Strings are not primitive data types. Unlike integers or characters, a String can be broken down into smaller individual data types (a sequence of char types).&lt;br&gt;
input.next() vs input.nextLine(): If you use next(), Java will only read the first word you type before a space. If you want to grab the entire sentence, you have to use nextLine().&lt;br&gt;
Wrapping Up Day 1&lt;br&gt;
Day 1 taught me that coding is 80% problem-solving logic and only 20% syntax. Taking the time to optimize a prime number loop on paper before writing a single line of Java showed me exactly why studying DSA is so important.&lt;/p&gt;

&lt;p&gt;What’s coming next: Tomorrow, I will be moving past the setup phase and diving deeper into Java variables, primitive data types, and taking clean user inputs.&lt;/p&gt;

&lt;p&gt;Are you studying DSA right now or thinking about starting? Let’s keep each other accountable! Leave a comment below with your favorite coding shortcut or what language you’re learning.&lt;/p&gt;

&lt;p&gt;CONTACT ME :&lt;/p&gt;

&lt;p&gt;Email : &lt;a href="mailto:mhjnmibhur23@gmail.com"&gt;mhjnmibhur23@gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;LinkedIn : &lt;a href="https://www.linkedin.com/in/mibhurmahajan" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/mibhurmahajan&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Twitter : &lt;a href="https://x.com/mhjnmibhur05" rel="noopener noreferrer"&gt;https://x.com/mhjnmibhur05&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
      <category>dsa</category>
      <category>programming</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
