<?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: Laxman Nemane</title>
    <description>The latest articles on DEV Community by Laxman Nemane (@laxmann).</description>
    <link>https://dev.to/laxmann</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2160250%2F2767a310-c5ff-4b7e-b98c-400d6ab8c754.jpeg</url>
      <title>DEV Community: Laxman Nemane</title>
      <link>https://dev.to/laxmann</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laxmann"/>
    <language>en</language>
    <item>
      <title>🔗 Linked List Explained Simply (Singly vs Doubly)</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Sat, 14 Mar 2026 08:15:09 +0000</pubDate>
      <link>https://dev.to/laxmann/linked-list-explained-simply-singly-vs-doubly-2fkp</link>
      <guid>https://dev.to/laxmann/linked-list-explained-simply-singly-vs-doubly-2fkp</guid>
      <description>&lt;p&gt;📚 &lt;strong&gt;Today I learned the Linked List concept in DSA&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I just read &lt;strong&gt;Linked List&lt;/strong&gt; and now I'll teach it. Linked List is one of the most beautiful concepts where most data manipulation happens, like &lt;strong&gt;insertion&lt;/strong&gt; and &lt;strong&gt;deletion&lt;/strong&gt;. For these operations, Linked List is the best use case.&lt;/p&gt;

&lt;p&gt;🔹 We'll learn what a &lt;strong&gt;Linked List&lt;/strong&gt; is. Basically, there are two types of Linked Lists:&lt;br&gt;
1️⃣ &lt;strong&gt;Singly Linked List&lt;/strong&gt;&lt;br&gt;
2️⃣ &lt;strong&gt;Doubly Linked List&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;➡️ &lt;strong&gt;Singly Linked List&lt;/strong&gt; means each node links to the next node. A node contains a &lt;strong&gt;value&lt;/strong&gt; and a &lt;strong&gt;reference to the next node&lt;/strong&gt;. This flow continues by connecting to the next node reference, which is why it is called &lt;em&gt;singly&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;↔️ The same thing happens in &lt;strong&gt;Doubly Linked List&lt;/strong&gt;, but in this case the node has &lt;strong&gt;two pointers&lt;/strong&gt;:&lt;br&gt;
• &lt;strong&gt;Next&lt;/strong&gt;&lt;br&gt;
• &lt;strong&gt;Previous&lt;/strong&gt; position reference&lt;/p&gt;

&lt;p&gt;📌 An additional thing: the &lt;strong&gt;first node&lt;/strong&gt; in a Linked List is technically called the &lt;strong&gt;head&lt;/strong&gt;, and the &lt;strong&gt;last node&lt;/strong&gt; is called the &lt;strong&gt;tail&lt;/strong&gt;. The &lt;strong&gt;tail points to null&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;This is what I learned today.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;🧠 We also have an exercise for &lt;strong&gt;tech leaders and coders&lt;/strong&gt;. If you know or you are learning, then solve this puzzle:&lt;/p&gt;

&lt;p&gt;addelementatindex(2,8) in 3,1,4,5&lt;br&gt;
➡️ 3,1,8,4,5&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>🫧 Bubble Sort Explained Simply</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Fri, 27 Feb 2026 04:52:51 +0000</pubDate>
      <link>https://dev.to/laxmann/bubble-sort-explained-simply-678</link>
      <guid>https://dev.to/laxmann/bubble-sort-explained-simply-678</guid>
      <description>&lt;p&gt;Let’s break it down in the simplest way possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🚀 What is Bubble Sort?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Bubble Sort is a simple &lt;strong&gt;comparison-based&lt;/strong&gt; sorting algorithm.&lt;br&gt;
It works by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repeatedly stepping through the list&lt;/li&gt;
&lt;li&gt;Comparing adjacent elements&lt;/li&gt;
&lt;li&gt;Swapping them if they are in the wrong order&lt;/li&gt;
&lt;li&gt;Repeating until the array is sorted&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;The largest elements "bubble up" to the end — hence the name Bubble Sort 🫧&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding Linear Search &amp; Binary Search 🔍</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Wed, 25 Feb 2026 18:45:37 +0000</pubDate>
      <link>https://dev.to/laxmann/understanding-linear-search-binary-search-2ca8</link>
      <guid>https://dev.to/laxmann/understanding-linear-search-binary-search-2ca8</guid>
      <description>&lt;p&gt;Today I learned about Linear Search and Binary Search.&lt;/p&gt;

&lt;p&gt;First, let’s talk about &lt;strong&gt;Linear Search&lt;/strong&gt;.&lt;br&gt;
It is an algorithm used to search for an element in an array.&lt;/p&gt;

&lt;p&gt;If we go deeper, Linear Search checks elements one by one from start to end until:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
The element is found, or&lt;br&gt;
The list ends.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let’s take a real-life example:&lt;/p&gt;

&lt;p&gt;If I am searching for the name "Lakhan" and it is present at index 4, then the 0th, 1st, 2nd, and 3rd iterations will fail. At the 4th iteration, &lt;em&gt;it will find the element, return it, and stop the loop&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That’s how Linear Search works.&lt;/p&gt;

&lt;p&gt;Now, let’s talk about &lt;strong&gt;Binary Search&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;On the internet, it says Binary Search is the fastest and most optimized way to search for an element. Basically, it is an optimized way to search an element in a sorted array.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It does not work on an unsorted array.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If we go deeper, Binary Search divides the array into halves each time. It checks the middle element and continues the search only in the relevant half, while ignoring the other half.&lt;/p&gt;

&lt;p&gt;This process continues until the element is found or the search space becomes empty.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>computerscience</category>
      <category>learning</category>
    </item>
    <item>
      <title>🚀 Day of Strengthening My DSA Fundamentals – JavaScript String Methods</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Tue, 24 Feb 2026 18:35:01 +0000</pubDate>
      <link>https://dev.to/laxmann/day-of-strengthening-my-dsa-fundamentals-javascript-string-methods-f10</link>
      <guid>https://dev.to/laxmann/day-of-strengthening-my-dsa-fundamentals-javascript-string-methods-f10</guid>
      <description>&lt;p&gt;Today I learned the remaining string methods in JavaScript.&lt;/p&gt;

&lt;p&gt;Yesterday, I posted on Dev Community about the string methods I had already learned.&lt;br&gt;
Here is the URL of that post:&lt;br&gt;
&lt;a href="https://dev.to/laxmann/day-of-strengthening-my-dsa-fundamentals-javascript-string-methods-44b9"&gt;https://dev.to/laxmann/day-of-strengthening-my-dsa-fundamentals-javascript-string-methods-44b9&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In that post, I covered the earlier methods.&lt;br&gt;
Now I’m sharing the methods I learned today.&lt;/p&gt;

&lt;p&gt;Let’s start by revising the string methods:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 slice()&lt;/strong&gt;&lt;br&gt;
Extracts a section of a string and returns a new string without modifying the original one.&lt;/p&gt;

&lt;p&gt;It takes two parameters:&lt;br&gt;
&lt;code&gt;startIndex&lt;br&gt;
endIndex&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The string between these two indexes is returned.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The startIndex is included.&lt;/li&gt;
&lt;li&gt;The endIndex is excluded.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🔹 split()&lt;/strong&gt;&lt;br&gt;
Converts a string into an array.&lt;br&gt;
It takes two parameters:&lt;br&gt;
&lt;code&gt;separator&lt;br&gt;
limit&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The separator defines where to split the string.&lt;br&gt;
The limit defines how many items you want in the resulting array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 substring()&lt;/strong&gt;&lt;br&gt;
Works similarly to slice().&lt;/p&gt;

&lt;p&gt;It takes:&lt;br&gt;
&lt;code&gt;startIndex&lt;br&gt;
endIndex&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And returns the part of the string between those indexes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 trim()&lt;/strong&gt;&lt;br&gt;
Removes whitespace from both ends of the string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 trimEnd()&lt;/strong&gt;&lt;br&gt;
Removes whitespace from the end of the string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 trimStart()&lt;/strong&gt;&lt;br&gt;
Removes whitespace from the beginning of the string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 startsWith()&lt;/strong&gt;&lt;br&gt;
Checks whether a string starts with a given character or substring.&lt;/p&gt;

&lt;p&gt;Returns:&lt;br&gt;
true&lt;br&gt;
false&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 toLocaleUpperCase()&lt;/strong&gt;&lt;br&gt;
Converts a string to uppercase using locale-specific case mapping.&lt;/p&gt;

&lt;p&gt;It can take a locale as a parameter.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 toUpperCase()&lt;/strong&gt;&lt;br&gt;
Converts a string to uppercase using default Unicode rules (not locale-specific).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔹 toLowerCase() / toLocaleLowerCase()&lt;/strong&gt;&lt;br&gt;
Same concept as uppercase methods, but converts the string to lowercase.&lt;/p&gt;

&lt;p&gt;✅ What I Learned Today&lt;br&gt;
Today I strengthened my understanding of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How string methods return new values&lt;/li&gt;
&lt;li&gt;The difference between slice() and substring()&lt;/li&gt;
&lt;li&gt;How split() works internally&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The difference between locale-based and default Unicode case conversion&lt;/p&gt;

&lt;p&gt;If you see any mistakes or have suggestions, please let me know.&lt;br&gt;
I continually improve my DSA fundamentals.&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>🚀 Day of Strengthening My DSA Fundamentals – JavaScript String Methods</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Mon, 23 Feb 2026 18:27:05 +0000</pubDate>
      <link>https://dev.to/laxmann/day-of-strengthening-my-dsa-fundamentals-javascript-string-methods-44b9</link>
      <guid>https://dev.to/laxmann/day-of-strengthening-my-dsa-fundamentals-javascript-string-methods-44b9</guid>
      <description>&lt;p&gt;Today, I focused on building strong fundamentals by learning and revising basic string operations in JavaScript.&lt;/p&gt;

&lt;p&gt;Mastering string manipulation is extremely important for coding interviews, especially for product-based companies and FAANG-level roles.&lt;/p&gt;

&lt;p&gt;Here’s what I learned today 👇&lt;/p&gt;

&lt;p&gt;📌 1️⃣ Basic Properties&lt;br&gt;
✅ length&lt;br&gt;
Returns the total number of characters in a string (including spaces).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Hello".length // 5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 2️⃣ Accessing Characters&lt;br&gt;
✅ at(index)&lt;/p&gt;

&lt;p&gt;Returns the character at a given index.&lt;br&gt;
Supports negative indexing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"Hello".at(1)  // "e"
"Hello".at(-1) // "o"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ charAt(index)&lt;/p&gt;

&lt;p&gt;Returns the character at a given index.&lt;br&gt;
❌ Does NOT support negative indexing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Hello".charAt(1) // "e"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 3️⃣ Searching in Strings&lt;br&gt;
✅ includes(searchString, position)&lt;/p&gt;

&lt;p&gt;Returns true or false.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"banana".includes("a")     // true
"banana".includes("b", 1)  // false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ indexOf(searchString, position)&lt;/p&gt;

&lt;p&gt;Returns the first occurrence index or -1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"banana".indexOf("a") // 1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ lastIndexOf(searchString)&lt;/p&gt;

&lt;p&gt;Returns the last occurrence index.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"banana".lastIndexOf("a") // 5

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 4️⃣ Modifying Strings&lt;br&gt;
✅ concat()&lt;/p&gt;

&lt;p&gt;Combines strings and returns a new string.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Hello".concat(" ", "World")

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ replace(pattern, replacement)&lt;/p&gt;

&lt;p&gt;Replaces only the first occurrence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"banana".replace("a", "x")
// "bxnana"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ replaceAll(pattern, replacement)&lt;/p&gt;

&lt;p&gt;Replaces all occurrences.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"banana".replaceAll("a", "x")
// "bxnxnx"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 5️⃣ Padding Methods&lt;br&gt;
✅ padStart(targetLength, padString)&lt;/p&gt;

&lt;p&gt;Adds characters at the beginning.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"7".padStart(3, "0")
// "007"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ padEnd(targetLength, padString)&lt;/p&gt;

&lt;p&gt;Adds characters at the end.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"34".padEnd(5, "*")
// "34***"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 6️⃣ Pattern Matching&lt;br&gt;
✅ match()&lt;/p&gt;

&lt;p&gt;Returns matched results (array) or null.&lt;br&gt;
Often used with regular expressions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
"banana".match(/a/g)
// ["a", "a", "a"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 Key Learnings&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Strings are immutable in JavaScript.&lt;/li&gt;
&lt;li&gt;Most string methods return a new string.&lt;/li&gt;
&lt;li&gt;Searching methods are case-sensitive.&lt;/li&gt;
&lt;li&gt;Understanding return types is very important for interviews.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consistency &amp;gt; Motivation 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  DSA #JavaScript #LearningInPublic #FrontendDeveloper #FAANGJourney
&lt;/h1&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>learning</category>
    </item>
    <item>
      <title>🚀 Today I Learned the Most Amazing DSA Concept — Recursion!</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Mon, 04 Aug 2025 05:18:33 +0000</pubDate>
      <link>https://dev.to/laxmann/today-i-learned-the-most-amazing-dsa-concept-recursion-3d29</link>
      <guid>https://dev.to/laxmann/today-i-learned-the-most-amazing-dsa-concept-recursion-3d29</guid>
      <description>&lt;p&gt;Hey friends,&lt;br&gt;
Today was mind-blowing 🤯 because I learned something in DSA that feels like magic — Recursion.&lt;/p&gt;

&lt;p&gt;It’s actually very simple… but at first, you might not fully get it. That’s okay! Keep practicing and one day, it will just click.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔍 What is Recursion?&lt;/strong&gt;&lt;br&gt;
Recursion is when a function calls itself using its own definition.&lt;/p&gt;

&lt;p&gt;There are two most important parts of recursion:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Base Case&lt;/em&gt;&lt;/strong&gt; → This stops the recursion (very important 🚨).&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Recursive Call&lt;/em&gt;&lt;/strong&gt; → Where the function calls itself again.&lt;/p&gt;

&lt;p&gt;🧠 &lt;strong&gt;A Real-Life Example&lt;/strong&gt;&lt;br&gt;
Imagine a queue of 6 people: A, B, C, D, E, F.&lt;/p&gt;

&lt;p&gt;A doesn’t know how many people are behind him, so he asks B.&lt;/p&gt;

&lt;p&gt;B doesn’t know either, so he asks C.&lt;/p&gt;

&lt;p&gt;This continues until F.&lt;/p&gt;

&lt;p&gt;F says, “Nobody is behind me!” (Base Case).&lt;/p&gt;

&lt;p&gt;Then the answer comes back step-by-step to A.&lt;/p&gt;

&lt;p&gt;That’s how recursion flows — going deep until a base case, then returning back.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Fun Fact&lt;br&gt;
If you type recursion in Google, it will say:&lt;br&gt;
Did you mean: recursion?&lt;br&gt;
Click it… and it will suggest recursion again. Infinite loop! 😂 Google is trolling us but also teaching recursion in a fun way.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🖥 Simple Programming Example&lt;br&gt;
javascript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
function fn(n) {
    console.log("Lakhan");
    n = n - 1;
    fn(n); // Recursive Call
}

fn(5);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ This will keep going forever and crash with Stack Overflow because there’s no base case.&lt;/p&gt;

&lt;p&gt;✅ Correct Way with Base Case&lt;br&gt;
javascript&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
function fn(n) {
    if (n === 0) return; // Base Case - stops recursion
    console.log("Lakhan");
    fn(n - 1); // Recursive Call
}

fn(5);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now it prints "Lakhan" 5 times and stops.&lt;/p&gt;

&lt;p&gt;🏗 How It Works in Call Stack&lt;br&gt;
fn(5) calls fn(4) (fn(5) is paused until fn(4) finishes)&lt;/p&gt;

&lt;p&gt;fn(4) calls fn(3)&lt;/p&gt;

&lt;p&gt;… and so on, until fn(0) hits the base case.&lt;/p&gt;

&lt;p&gt;Then functions start returning one by one.&lt;/p&gt;

&lt;p&gt;❌ &lt;strong&gt;Common Mistakes to Avoid&lt;/strong&gt;&lt;br&gt;
❌ Missing base case → Infinite loop!&lt;br&gt;
❌ Not simplifying input (always do n-1, n+1, etc.)&lt;br&gt;
❌ Deep recursion with huge input → May crash or freeze&lt;br&gt;
❌ Ignoring time complexity&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⏳ Time Complexity&lt;/strong&gt;&lt;br&gt;
For most simple recursive functions like above, the time complexity is O(n) — similar to a loop because the code block runs n times.&lt;/p&gt;

&lt;p&gt;💬 Final Tip →&lt;br&gt;
Always put the base case at the top and think about how the input changes with each call. Practice daily, and one day recursion will feel as natural as loops.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Keep practicing and keep coding!&lt;/em&gt;&lt;/strong&gt; 🚀&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>dsa</category>
      <category>leetcode</category>
      <category>developer</category>
    </item>
    <item>
      <title>📘 Today I Learned: Time and Space Complexity</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Mon, 21 Jul 2025 10:21:47 +0000</pubDate>
      <link>https://dev.to/laxmann/today-i-learned-time-and-space-complexity-2hk1</link>
      <guid>https://dev.to/laxmann/today-i-learned-time-and-space-complexity-2hk1</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Time Complexity?&lt;/strong&gt;&lt;br&gt;
Time complexity is the measure of efficiency of an algorithm as the size of the input grows.&lt;br&gt;
It tells us how many operations an algorithm takes to complete, depending on input size n.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Myth: Time complexity ≠ Time taken&lt;br&gt;
✅ Fact: Time taken depends on machine, language, and environment.&lt;br&gt;
✅ Time complexity is theoretical—it gives a general idea of algorithm performance.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What is an Algorithm?&lt;br&gt;
An algorithm is simply a step-by-step solution to a problem.&lt;/p&gt;

&lt;p&gt;Key Insight:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Lower time complexity = Better performance&lt;br&gt;
So we prefer algorithms with less complexity when solving problems.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🔍 Example: Linear Search vs Binary Search&lt;br&gt;
Linear Search:&lt;br&gt;
Works on both sorted and unsorted arrays&lt;/p&gt;

&lt;p&gt;Time Complexity: O(n)&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// array = [2, 3, 4, 5, 6]
// Find 4 by looping through each element
Binary Search:
Works only on sorted arrays

Time Complexity: O(log n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
// array = [2, 3, 4, 5, 6]
// Start with middle, divide in half repeatedly
Feature Linear Search   Binary Search
Input Requirement   Sorted/Unsorted Sorted only
Approach    Loop through each   Divide &amp;amp; conquer
Time Complexity O(n)    O(log n)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Binary Search is faster and more efficient than Linear Search on sorted data.&lt;/p&gt;

&lt;p&gt;🧠 Common Time Complexities (With Examples):&lt;br&gt;
O(1) — Constant Time&lt;/p&gt;

&lt;p&gt;Example: arr&lt;a href="https://dev.toaccessing%20an%20index"&gt;5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;O(log n) — Logarithmic Time&lt;/p&gt;

&lt;p&gt;Example: Binary Search&lt;/p&gt;

&lt;p&gt;O(n) — Linear Time&lt;/p&gt;

&lt;p&gt;Example: Linear Search&lt;/p&gt;

&lt;p&gt;O(n log n) — Linearithmic Time&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
for (i = 0; i &amp;lt; n; i++) {
  binarySearch();
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;O(n²) — Quadratic Time&lt;/p&gt;

&lt;p&gt;Example: Nested loops (e.g., bubble sort)&lt;/p&gt;

&lt;p&gt;O(n³) — Cubic Time&lt;/p&gt;

&lt;p&gt;Example: Three nested loops&lt;/p&gt;

&lt;p&gt;O(2ⁿ) — Exponential Time&lt;/p&gt;

&lt;p&gt;Example: Recursive Fibonacci&lt;/p&gt;

&lt;p&gt;O(n!) — Factorial Time&lt;/p&gt;

&lt;p&gt;Example: Generating all permutations&lt;/p&gt;

&lt;p&gt;⚠️ Note: O(2ⁿ) and O(n!) are rarely used because they're very inefficient.&lt;/p&gt;

&lt;p&gt;🔺 Time Complexity Graph:&lt;br&gt;
Here’s a visual graph representing different complexities from best to worst:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time Complexity Graph&lt;/strong&gt;&lt;/p&gt;

&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.amazonaws.com%2Fuploads%2Farticles%2F4pvhwvdu6fadiji1xblb.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.amazonaws.com%2Fuploads%2Farticles%2F4pvhwvdu6fadiji1xblb.png" alt=" " width="620" height="654"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Final Time Complexity Ranking:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;O(1) &amp;lt; O(log n) &amp;lt; O(n) &amp;lt; O(n log n) &amp;lt; O(n²) &amp;lt; O(2ⁿ) &amp;lt; O(n!)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>dsa</category>
      <category>javascript</category>
      <category>coding</category>
    </item>
    <item>
      <title>🧠 DSA Day 6</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Thu, 17 Jul 2025 05:02:55 +0000</pubDate>
      <link>https://dev.to/laxmann/dsa-day-6-5b56</link>
      <guid>https://dev.to/laxmann/dsa-day-6-5b56</guid>
      <description>&lt;p&gt;Today was a productive day! I worked on a few fundamental JavaScript concepts that are super useful in Data Structures and Algorithms:&lt;/p&gt;

&lt;p&gt;✅ Count Digits Program&lt;br&gt;
Wrote a function to count the number of digits in a number. Practiced using loops and type conversion for this.&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function countDigits(num) {
  return num.toString().length;
}
console.log(countDigits(12345)); // Output: 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Math Methods – Explored:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Math.floor(4.7) ➝ 4 (rounds down)

Math.ceil(4.2) ➝ 5 (rounds up)

Math.round(4.5) ➝ 5 (rounds to nearest)

Math.abs(-10) ➝ 10 (returns absolute value)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These methods are very handy when working with calculations, arrays, or loops.&lt;/p&gt;

&lt;p&gt;✅ Palindrome Number&lt;br&gt;
Wrote a function to check if a number reads the same backward (like 121, 1331).&lt;br&gt;
Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function isPalindrome(num) {
  let str = num.toString();
  return str === str.split('').reverse().join('');
}
console.log(isPalindrome(121)); // Output: true
console.log(isPalindrome(123)); // Output: false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🛠️ All these basics are helping me get more comfortable with JavaScript and strengthen my logic-building skills for DSA.&lt;/p&gt;

&lt;p&gt;🔁 Small wins each day add up. On to Day 7!&lt;/p&gt;

</description>
      <category>dsa</category>
      <category>javascript</category>
      <category>programming</category>
      <category>developer</category>
    </item>
    <item>
      <title>🟦 DSA Day 5</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Wed, 16 Jul 2025 11:31:47 +0000</pubDate>
      <link>https://dev.to/laxmann/dsa-day-5-3jai</link>
      <guid>https://dev.to/laxmann/dsa-day-5-3jai</guid>
      <description>&lt;p&gt;Today I revised what I’ve learned so far and practiced for loops by solving a few star pattern problems.&lt;br&gt;
It helped me recall the logic and understand how nested loops work more clearly.&lt;/p&gt;

&lt;p&gt;⭐ Patterns I tried:&lt;br&gt;
&lt;code&gt;&lt;br&gt;
Right-angled triangle&lt;br&gt;
Inverted triangle&lt;br&gt;
Pyramid (basic)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Keeping it simple, but consistent. 💪&lt;/p&gt;

</description>
      <category>programming</category>
      <category>dsa</category>
      <category>javascript</category>
      <category>development</category>
    </item>
    <item>
      <title>🧠 DSA Series - Day 4</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Fri, 11 Jul 2025 04:57:07 +0000</pubDate>
      <link>https://dev.to/laxmann/dsa-series-day-4-4mgb</link>
      <guid>https://dev.to/laxmann/dsa-series-day-4-4mgb</guid>
      <description>&lt;p&gt;Simple Pattern Programs&lt;br&gt;
Yesterday, I practiced some basic pattern problems using nested loops in JavaScript. Although I missed posting the update, here’s a quick recap of what I learned.&lt;/p&gt;

&lt;p&gt;🔹 1. &lt;strong&gt;Square Pattern&lt;/strong&gt;&lt;br&gt;
I started with a simple square pattern where each row and column prints the same character:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; // Example 1
* * * *
* * * *
* * * *
* * * *

📌 What I learned:
**i** represents the **row**
**j** represents the **column**


for (let i = 0; i &amp;lt; 4; i++) {
  let row = "";
  for (let j = 0; j &amp;lt; 4; j++) {
    row += "* ";
  }
  console.log(row);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹 2. Incremental Number Pattern&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Example 2
1 2 3
1 2 3
1 2 3

for (let i = 1; i &amp;lt;= 3; i++) {
  let row = "";
  for (let j = 1; j &amp;lt;= 3; j++) {
    row += j + " ";
  }
  console.log(row);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧩 Observation:&lt;br&gt;
Again, i = rows, j = columns. The column value (j) is what’s changing inside the row.&lt;/p&gt;

&lt;p&gt;✍️ Key Takeaway:&lt;br&gt;
Understanding how nested loops work is key to solving pattern problems. The outer loop usually controls the rows, and the inner loop handles the columns.&lt;/p&gt;

&lt;p&gt;More patterns coming soon in my DSA practice journey. &lt;strong&gt;Happy coding&lt;/strong&gt;! 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>🧠 DSA Series - Day 3</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Wed, 09 Jul 2025 19:04:30 +0000</pubDate>
      <link>https://dev.to/laxmann/dsa-series-day-3-3dab</link>
      <guid>https://dev.to/laxmann/dsa-series-day-3-3dab</guid>
      <description>&lt;p&gt;📌 Topic: For Loop Practice – Real-World Problems&lt;/p&gt;

&lt;p&gt;Today is our practice session on loops. We are solving beginner-friendly problems using the for loop. Make sure to understand edge cases — this habit will save you from bugs and unexpected behaviors. 🚀&lt;/p&gt;

&lt;p&gt;✅ 1. Find the Index of a Given Element&lt;br&gt;
Problem:&lt;br&gt;
Search for a specific element in an array. If it exists, return its index. If not, return -1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
function searchElement(arr, element) {
  for (let i = 0; i &amp;lt; arr.length; i++) {
    if (arr[i] === element) {
      return i;
    }
  }
  return -1;
}

let res = searchElement([12, 8, 4, 2, 99], 99);
console.log("Index:", res);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ 2. Count Positive and Negative Numbers&lt;br&gt;
Problem:&lt;br&gt;
Count how many positive and negative numbers are in an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
function checkCount(arr) {
  let positiveCount = 0;
  let negativeCount = 0;

  for (let i = 0; i &amp;lt; arr.length; i++) {
    if (arr[i] &amp;gt; 0) {
      positiveCount++;
    } else {
      negativeCount++;
    }
  }

  return { positiveCount, negativeCount };
}

let res = checkCount([12, 8, 4, 2, -99]);
console.log("Counts:", res);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ 3. Find the Largest Number&lt;br&gt;
Problem:&lt;br&gt;
Find the largest number in a given array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
function findLargest(arr) {
  let largeNumber = arr[0];

  for (let i = 1; i &amp;lt; arr.length; i++) {
    if (arr[i] &amp;gt; largeNumber) {
      largeNumber = arr[i];
    }
  }

  return largeNumber;
}

let res = findLargest([12, 8, 4, 2, -99]);
console.log("Largest:", res);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ 4. Find the Second Largest Number&lt;br&gt;
Problem:&lt;br&gt;
Find the second largest number in an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function findSecondLargest(arr) {
  if (arr.length &amp;lt; 2) {
    return "Array must contain at least 2 elements";
  }

  let fl = -Infinity; // First Largest
  let sl = -Infinity; // Second Largest

  for (let i = 0; i &amp;lt; arr.length; i++) {
    if (arr[i] &amp;gt; fl) {
      sl = fl;
      fl = arr[i];
    } else if (arr[i] &amp;gt; sl &amp;amp;&amp;amp; arr[i] !== fl) {
      sl = arr[i];
    }
  }

  return { firstLargest: fl, secondLargest: sl };
}

let res = findSecondLargest([12, 8, 4, 2, 99]);
console.log("Second Largest:", res);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🎯 Takeaway:&lt;br&gt;
Always test your code for edge cases like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Empty arrays&lt;/li&gt;
&lt;li&gt;All elements being the same&lt;/li&gt;
&lt;li&gt;Arrays with only negative numbers&lt;/li&gt;
&lt;li&gt;Arrays with one element&lt;/li&gt;
&lt;li&gt;Practicing like this strengthens your fundamentals. Stay consistent and keep building!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💬 Let me know which one was your favorite or if you faced any issues!&lt;/p&gt;

&lt;p&gt;💻 Until tomorrow, Happy Coding! 👨‍💻✨&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>dsa</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>✅ DSA Learning – Day 2:</title>
      <dc:creator>Laxman Nemane</dc:creator>
      <pubDate>Tue, 08 Jul 2025 17:55:48 +0000</pubDate>
      <link>https://dev.to/laxmann/dsa-learning-day-2-p46</link>
      <guid>https://dev.to/laxmann/dsa-learning-day-2-p46</guid>
      <description>&lt;p&gt;Today, I learned about functions in JavaScript — how they are declared, how they work, and some basic control flow using if, else, and else if blocks.&lt;/p&gt;

&lt;p&gt;🔹&lt;strong&gt;What is a Function in JavaScript?&lt;/strong&gt;&lt;br&gt;
A function is a reusable block of code that performs a specific task. You can define a function using the function keyword followed by a name and a&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function greet() {
  console.log("Hello, world!");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can call the function by using its name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;greet(); // Output: Hello, world!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹&lt;strong&gt;Dynamic Functions with Parameters&lt;/strong&gt;&lt;br&gt;
Functions can also accept parameters, which makes them dynamic and reusable with different inputs. For example, summing two numbers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
function sum(a, b) {
  console.log("Sum is:", a + b);
}

sum(5, 3); // Output: Sum is: 8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, a and b are parameters, and we passed different values (arguments) when calling the function.&lt;/p&gt;

&lt;p&gt;🔹&lt;strong&gt;Returning Values from Functions&lt;/strong&gt;&lt;br&gt;
You can also return a value from a function using the return keyword:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function multiply(x, y) {
  return x * y;
}

let result = multiply(4, 5);
console.log(result); // Output: 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔹&lt;strong&gt;If / Else Conditions&lt;/strong&gt;&lt;br&gt;
I also learned about basic conditional logic using if, else, and else if:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let num = 10;

if (num &amp;gt; 10) {
  console.log("Greater than 10");
} else if (num === 10) {
  console.log("Equal to 10");
} else {
  console.log("Less than 10");
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are used to control the flow based on conditions.&lt;/p&gt;

&lt;p&gt;🔹&lt;strong&gt;for loop&lt;/strong&gt;&lt;br&gt;
— what it is and how it works.&lt;br&gt;
A for loop is used to perform repetitive tasks. It runs a block of code multiple times based on a condition.&lt;/p&gt;

&lt;p&gt;The for loop has three main parts:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Initialization&lt;/strong&gt;– where we set the starting point (e.g., let i = 0)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Condition check&lt;/strong&gt; – the loop runs only if this condition is true&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;_Increment/Update _&lt;/strong&gt;– after each iteration, the loop variable is updated (e.g., i++)&lt;/p&gt;

&lt;p&gt;If the condition becomes false, the loop stops.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
for (let i = 0; i &amp;lt; 5; i++) {
  console.log(i);
}
What happens here:
Initialization: let i = 0
Condition: i &amp;lt; 5 → if true, run the block
After printing i, increment i using i++
Repeat until i &amp;lt; 5 becomes false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📌 &lt;strong&gt;Summary&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A function performs a task and can be reused.&lt;/li&gt;
&lt;li&gt;You can pass parameters to make it dynamic.&lt;/li&gt;
&lt;li&gt;Functions can return values.&lt;/li&gt;
&lt;li&gt;Use if, else if, and else to control decision-making in code.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Until tomorrow, Happy coding&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
