<?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 Ishavenkadesh on Medium]]></title>
        <description><![CDATA[Stories by Ishavenkadesh on Medium]]></description>
        <link>https://medium.com/@ishavenkadesh03?source=rss-4e76f2e8586c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*bN62_z3YykvNFMF4</url>
            <title>Stories by Ishavenkadesh on Medium</title>
            <link>https://medium.com/@ishavenkadesh03?source=rss-4e76f2e8586c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:19:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ishavenkadesh03/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[Permutations]]></title>
            <link>https://medium.com/@ishavenkadesh03/permutations-a47a2b6830f3?source=rss-4e76f2e8586c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a47a2b6830f3</guid>
            <dc:creator><![CDATA[Ishavenkadesh]]></dc:creator>
            <pubDate>Sun, 14 Jun 2026 18:27:29 GMT</pubDate>
            <atom:updated>2026-06-14T19:21:39.078Z</atom:updated>
            <content:encoded><![CDATA[<p>for n, there will be n! of permutations</p><p>Contains every element in every permutation either in correct order or i jumbled</p><pre>//sorting inside ArrayList<br>result.sort((a, b) -&gt; Integer.compare(a.length(), b.length()));//for String<br>result.sort((a, b) -&gt; Integer.compare(a.size(), b.size()));//for Integer<br><br>//sorting for Array<br>Arrays.sort(result)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_jg7C8kOQKRYUOG486U0A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BihQi3lTfTr395iuQUJIYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cGcE1YSAULBvTLa53ag1mA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*vtuUY-HLWNd5YJFtIKEuwQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*eON0Yf5asAxN6Z2175rPDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Fqq2kWTWe5RXJCFz42cAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJImMnV2OC5pilwgQ-NH4w.png" /></figure><p>OUTPUT:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*J-jjFQswfWIWIR67mFHBEg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a47a2b6830f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Recursion Subset, Subsequence and String]]></title>
            <link>https://medium.com/@ishavenkadesh03/recursion-subset-subsequence-and-string-ea4b305e787f?source=rss-4e76f2e8586c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea4b305e787f</guid>
            <dc:creator><![CDATA[Ishavenkadesh]]></dc:creator>
            <pubDate>Wed, 10 Jun 2026 04:21:53 GMT</pubDate>
            <atom:updated>2026-06-14T07:41:36.993Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*Q8Vgg6WIyCEWazKlkAQYBQ.png" /></figure><ul><li>Every <strong>Substring</strong> is also a <strong>Subsequence</strong>.</li><li>Every <strong>Subsequence</strong> is also a <strong>Subset</strong>.</li></ul><p>but not reversed.</p><p>SubArray is for arrays and Subsequence is for String.</p><p>Basic string question refer VS code</p><p>The below one is very basic (goal is to remove A):</p><p>don’t do the below method instead use the recursion method</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zUt99a3XrwL0Yb4zzPFK5w.png" /></figure><p>For String use the below method, without taking index as extra parameter — use substring method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*AYumhJbU_yTSlTHurouBFg.png" /></figure><p>p - processed, up - unprocessed</p><p>Here, p will contain the string without the char ‘a’ and passed to the next recursion call.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*350CD-FgpV_PLnslYO_HDw.png" /></figure><p>Returning the output (String) <br>- in line num 49, the ch of previous calls will wait for the next recursion calls result. When input string get emptied, the previous ch will get added in every return. (Please debug the code for better understanding)</p><h3>SUBSET(Recursion)</h3><p>When to apply subset pattern:</p><p>number of answers = 2^n (empty set is also added)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uxacSF54jPtX1-Pa82Htig.png" /></figure><p>The pattern of taking some elements and removing some elements known as <strong>SUBSET</strong> pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*4U8uEjt72W4RVr8d_-uGLA.png" /></figure><p>To avoid creating new strings, we can use stringBuilder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*dzChVnUHcmlB4MO4-0MPkg.png" /></figure><p>Returning in String</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*UIcWZC7leWeqiefOwr2jew.png" /></figure><p>Returning in List</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*YGfo1aBAInMNJ7RlsyF9Zg.png" /></figure><p>Normal:</p><pre>System.out.println(subsetArrayList(&quot;&quot;, str));<br><br>//Output: [abc, ab, ac, a, bc, b, c]</pre><p>To sort:</p><pre>ArrayList&lt;String&gt; result = subsetArrayList(&quot;&quot;, str);<br>result.sort((a, b) -&gt; Integer.compare(a.length(), b.length()));<br>System.out.println(result);<br><br>//Output: [a, b, c, ab, ac, bc, abc]</pre><h3>SUBSET(Iteration)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0UQvIkvuwMLaYMua136frA.png" /></figure><pre>List&lt;List&lt;Integer&gt;&gt; result = subsequenceInIteration(arr);<br><br>System.out.println(result);<br>//Output: [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3]]<br><br><br>for (List&lt;Integer&gt; list : result) {<br>    System.out.println(list);<br>}<br>//Output: []<br>//[1]<br>//[2]<br>//[1, 2]...<br><br><br>//SORT <br>result.sort((a, b) -&gt; Integer.compare(a.size(), b.size()));<br>System.out.println(result);<br>//Output: [[], [1], [2], [3], [1, 2], [1, 3], [2, 3], [1, 2, 3]]<br><br><br><br>//TO GET SORT LISTBYLIST<br>result.forEach(System.out::println);<br>//[]<br>//[1]<br>//[2]<br>//[3]<br>//[1, 2]...</pre><p>Handling Duplicates in Iteration,</p><ol><li>When you find a duplicate element, only add it in the newly created subset of previous step.</li><li>Because of above point, duplicate must be together. Sort the array first, otherwise it is complicate</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*ssYeD-vtNN3LICZ6YU2OIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cGJ-AlAMXlECWot8bDTxLw.png" /></figure><p>here in outerList.get(j) is kept inside new ArrayList&lt;&gt;(outerList.get(j)). The construction is nothing but <strong>collection</strong>. It will first do the copy of the entire list of index j and create it as new List. Then internal.add(arr[i]) -&gt; adding element to it.</p><h4>Complexity (Iteration):</h4><p>Time complexity: O(n * 2^n), n is length of array — 2^n is no of subset<br>Space complexity: O(n * 2^n), n is length of array — 2^n is no of subset</p><h4><strong>ArrayList&lt;ArrayList&lt;Integer&gt;&gt; VS List&lt;List&lt;Integer&gt;&gt;</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*yDtmg2YSbNvtS9jAyVLo1g.png" /></figure><p>List — can’t be initialized<br>- example: List&lt;Integer&gt; = new List&lt;&gt;(); <br>- this give us error, can’t be initialized only declaration is allowed.<br>- either initialize using ArrayList&lt;&gt;() or LinkedList&lt;&gt;()<br>- List&lt;Integer&gt; = new ArrayList&lt;&gt;();<br>- or List&lt;Integer&gt; = new LinkedList&lt;&gt;();</p><p>Using List&lt;List&lt;Integer&gt;&gt; is recommended, loose coupling.<br>If we initialized as ArrayList, we can change to LinkedList any time</p><pre>LIST WORKS AS:<br><br>List&lt;List&lt;Integer&gt;&gt; matrix = new ArrayList&lt;&gt;();<br><br>// Add rows, we can add as list of values<br>matrix.add(new ArrayList&lt;&gt;(Arrays.asList(1, 2, 3)));<br>matrix.add(new ArrayList&lt;&gt;(Arrays.asList(4, 5, 6)));<br><br>System.out.println(matrix);</pre><pre>ARRAYLIST WORKS AS:<br><br>ArrayList&lt;ArrayList&lt;Integer&gt;&gt; matrix = new ArrayList&lt;&gt;();<br><br>ArrayList&lt;Integer&gt; row1 = new ArrayList&lt;&gt;();<br><br>//here add only by a single num<br>row1.add(1);<br>row1.add(2);<br>matrix.add(row1);<br><br>System.out.println(matrix);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea4b305e787f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[String and StringBuffer]]></title>
            <link>https://medium.com/@ishavenkadesh03/string-and-stringbuffer-8c4bd338cf17?source=rss-4e76f2e8586c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c4bd338cf17</guid>
            <dc:creator><![CDATA[Ishavenkadesh]]></dc:creator>
            <pubDate>Sat, 14 Mar 2026 06:46:29 GMT</pubDate>
            <atom:updated>2026-03-14T06:46:29.059Z</atom:updated>
            <content:encoded><![CDATA[<p>What is String and why StringBuffer came into picture</p><h4><strong>STRING</strong></h4><p>String name = “Vinisha”;<br>String - datatype<br>name - variable<br>Vinisha - Object</p><blockquote><em>Objects store in heap memory</em></blockquote><h4><strong>CONCEPTS</strong></h4><ul><li>String pool</li><li>Immutability</li></ul><p>STRING POOL and IMMUTABILITY:</p><ul><li>String pool is the separate memory structure inside the heap. It is used for if the object is already present inside the string pool, then the variable will point to that, else it will create a new object.</li><li>If any one of the object got changed, it will create a new object inside string pool, then point towards it(Immutability).</li></ul><pre>String name1 = new String(&quot;Vini&quot;);<br>String name2 = new String(&quot;Vini&quot;);</pre><ul><li>The above name1, name2 object will be stored in the heap memory not inside the string pool, so the reference pointing towards this will be different, even the object is same.</li></ul><blockquote>.equals() - will check only the value and return true/false</blockquote><blockquote>== - will check both the value and the reference point and return true/false</blockquote><h4>PRETTY PRINTING(printf)</h4><blockquote>System.out.printf(“Formatted number: %.2f”,Math.PI)<br>System.out.printf(“My name is %s and I’m %s, “Vini”,”cool”)</blockquote><pre>%c - Character<br>%d - Decimal number (base 10)<br>%e - Exponential floating-point number<br>%f - Floating-point number<br>%i - Integer (base IO)<br>%o - Octal number (base 8)<br>%s - String<br>%u - Unsigned decimal (integer) number<br>%x - Hexadecimal number (base 16)<br>%t - Date/time<br>%n - Newline</pre><h4>STRING CONCATENATION</h4><p>OK. See whatever data type it is, at end while it is printing it will be converted into String. <br>Example: for Integer at first it goes through .toValue() then, .toString()<br>finally it prints in String datatype</p><pre>System.out.println(&quot;a&quot; + &#39;b&#39;); //ab<br>System.out.println(&quot;a&quot; + &quot;b&quot;); //ab<br>System.out.println(&#39;a&#39; + 1); //98 ascii number<br>System.out.println((char)(&#39;a&#39; + 1)); //b<br>System.out.println(&#39;a&#39; + &#39;c&#39;); //196<br>System.out.println(&quot;a&quot; + new ArrayList&lt;&gt;()); //a[]<br>// System.out.println(new Integer(35) + new ArrayList&lt;&gt;()); //gives error, atleast one<br>// string needed inbetween to concatenate 2 complex datatypes<br>System.out.println(new Integer(35) + &quot;&quot; + new ArrayList&lt;&gt;()); //35[]</pre><p>only the ‘+’ operator has this privilege, other mathematical operator like -, *, / is used only for maths operation</p><h4>MEMORY PERFORMANCE</h4><pre>String series = &quot;&quot;;<br>for (int i = 0; i &lt; 26; i++) {<br>    char ch = (char) (&#39;a&#39; + i);<br>    series += ch;<br>}<br>System.out.println(series);</pre><p>Here, the series creates new new object inside string pool in every iteration and there will be lot of memory waste and wastage of space. <br>In every iteration the size also getting inside by 1, so O(n(n+1)/2) <br>- loop it’s taking O(n)<br>- adding char to the original string taking O(n)<br>- O(n * n) = O(n²)<br>which is time complexity of <strong>O(n²)</strong>. Very bad approach. String is immutable so it won’t allow as to modify its object.</p><p>To overcome this, we have another solution named <strong>“STRING BUILDER”.<br></strong>modifying the original object, so the time complexity will be O(n)</p><h4>STRING BUILDER</h4><p>String Builder itself a class, so when we creating class we shouldn’t name our class as ‘StringBuilder.java’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*uV3hiG_x0uqDkx5RUaTNAA.png" /></figure><pre>StringBuilder builder = new StringBuilder();<br>for (int i = 0; i &lt; 26; i++) {<br>    char ch = (char) (&#39;a&#39; + i);<br>    builder.append(ch);<br>}<br>System.out.println(builder)<br>//stringBuilder provides many methods to play around it<br>eg: builder.append, reverse, deleteCharAt(0),...</pre><h4>METHODS</h4><p>In String, the original object won’t get modified. New object will be created same for the below method examples</p><pre>public static void main(String[] args) {<br>  String name = &quot;  Vinisha Venkadesh  &quot;;<br>  System.out.println(name.trim()); //removes leading and trailing zeros<br>  System.out.println(name.strip()); //removes leading and trailing zeros <br>  //but more robust and handle international whitespace characters<br>  System.out.println(Arrays.toString(name.toCharArray()));<br>  System.out.println(Arrays.toString(name.split(&quot; &quot;)));<br>  System.out.println(name.indexOf(&quot;Vini&quot;)); //space also considered as index<br>  System.out.println(name.indexOf(&#39;a&#39;));<br>  System.out.println(name.substring(2, 3)); //end index won&#39;t be took, <br>  // works as [2,3) include 2, excludes 3 if [2,2) answer will be empty<br>  System.out.println(name.toLowerCase());<br>}<br><br><br>OUTPUT:<br>Vinisha Venkadesh<br>Vinisha Venkadesh<br>[ ,  , V, i, n, i, s, h, a,  , V, e, n, k, a, d, e, s, h,  ,  ]<br>[, , Vinisha, Venkadesh]<br>2<br>8<br>V<br>  vinisha venkadesh</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c4bd338cf17" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sorting]]></title>
            <link>https://medium.com/@ishavenkadesh03/sorting-0d5f732734fe?source=rss-4e76f2e8586c------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d5f732734fe</guid>
            <dc:creator><![CDATA[Ishavenkadesh]]></dc:creator>
            <pubDate>Mon, 02 Mar 2026 18:50:33 GMT</pubDate>
            <atom:updated>2026-07-05T01:31:29.823Z</atom:updated>
            <content:encoded><![CDATA[<p>Sorting and their types</p><ul><li>Bubble sort — aka — Sinking sort/Exchange sort</li><li>Quick sort</li><li>Insertion sort</li><li>Count sort</li><li>Radix sort</li></ul><p>Recursion</p><ul><li>Merge sort</li><li>quick sort</li></ul><p><strong>Stable and Unstable sorting</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*ivLJHPQFYcA8_kkfCA0kVQ.png" /></figure><p>if it maintains it’s position i.e; if the black ball comes after red ball, the position is not maintained, so it is <strong>Unstable</strong>. If the red ball comes after black ball, the position is maintained it is <strong>Stable.</strong></p><p>Complexity:</p><p><strong>Space complexity</strong><br>O(1) - Constant — no extra space has been used, aka inplace sorting algorithm (No extra arr)</p><p><strong>Time complexity</strong><br>O(1) - Best case<br>O(n²) - Worst case, where n is the length of arr<br><em>Constants and less dominating terms are removed because we don’t need the exact time, we only need the relationship. We need mathematical function.</em></p><h3><strong>BUBBLE SORT:</strong></h3><p>AKA Sinking sort/Exchange sort - stable sorting algorithm</p><p>Comparing each element with previous element and making it sorted by bringing largest element at last (j &lt; arr.length - i - 1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*e4wIuCY_qXarsuBXHKnjKQ.png" /></figure><h4>Complexity:</h4><p>Space complexity: O(1)</p><p>Best Case: O(n) - sorted<br>Worst Case: O(n²) - sorted desc</p><h4>Stability:</h4><p>Stable - YES, it is a stable sorting algorithm</p><h3>SELECTION SORT</h3><p>Selecting the element and putting it in correct index. Here to achieve this we’re taking max</p><p>Taking max in whole array and moving it to the last index, doing it for every element by making the array smaller in each step. At first, marking max = arr[0] and starts the loop from 1. Finding max in loop till <br>(j &lt; arr.length - i - 1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*9odyB78FWRJHCd9zhA6gsg.png" /></figure><h4>Complexity:</h4><p>Space complexity: O(1)</p><p>Best Case: O(n²) - Anyway we gonna compare all the element to find max in each step<br>Worst Case: O(n²) - sorted desc</p><h4>Stability:</h4><p>Stable - NO, it is a unstable sorting algorithm</p><h4>Use case:</h4><p>It performs well on small lists/Array</p><h3>INSERTION SORT</h3><p>We’re partially sorting the array, first sort till index 1, then till index 2 and so on… The left hand side of the array is getting sorted in every pass</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*9Zyt-z4Jz3rGY_YiLF9cJQ.png" /></figure><h4>Complexity:</h4><p>Space complexity: O(1)</p><p>Best Case: O(n) - we’ve added the step to break the loop, if (j &gt; j - 1), because we know left hand side is already sorted.<br>Worst Case: O(n²) - sorted desc</p><h4>Stability:</h4><p>Stable — YES, it is a stable sorting algorithm</p><h4>Why insertion sort?:</h4><ul><li>Steps get reduced if array is sorted.</li><li>Number of steps reduced as compared to bubble sort, because in bubble sort after comparing to all element and if isAsc is true, it will break but here if previous element is smaller break will happen there itself.</li><li>Used for smaller values of N, works good in when parts of arrays are (partially sorted) — takes part in hybrid sorting algorithms</li><li>Inbuilt sorting — very high possibilities insertion sort is used with merge sort and quick sort.</li></ul><h3>CYCLIC SORT</h3><blockquote><strong>Hints:</strong> <strong>O(n), range [1-N], range[0-N], smallest positive integer not in the given input array</strong></blockquote><p>Every element should be in there respective index, if the index and the element matches, i++. This will helps in duplicate elements in a list too.</p><p><em>correctIndex = arr[i] — 1;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*S0Q9wfxKwFmbmN2Q4K97Xw.png" /></figure><h4>Complexity:</h4><p>Space complexity: O(1)</p><p>Best Case: O(n) — single loop<br>Worst Case: O(n) — single loop</p><h4>Stability:</h4><p>Stable — NO, it is a unstable sorting algorithm</p><blockquote>RECURSION</blockquote><h3>MERGE SORT (Better for linked list)</h3><p>We’ll first sort the <strong><em>first</em></strong> half of the array and sort the <strong><em>second</em></strong> half of the array and <strong><em>merge</em></strong> both half and we get the sorted array.</p><ol><li>Run in recursion and at the end the base condition is <br><strong>arr.length == 1</strong></li><li>Two methods:<br>- <strong>Using extra spaces</strong> — Taking copy as new array (first half and second half separately as 2 array) then pass it in the recursion<em> left and right. </em>This will take extra space and original array isn’t modified.<br>- <strong>In place sorting algorithm </strong>— here we’ll pass the indexes of an array, use one extra array and sort it back in original array.</li></ol><h4>First method - Using Extra space</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*bgelYikLDOe7sFGwNLekpg.png" /></figure><ol><li>Arrays.copyOfRange(arr,from index,end + 1 index) - last index will be excluded.</li><li>This will take a copy and create a completely new array and pass it to the parameter on next call.</li></ol><h4>Helper function to get sorted</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*gkGGeG_qhm4kHKEYUznbUQ.png" /></figure><p>This will also take new array for sorting (extra spaces). The original array won’t get modified. If we want to modify the original array do the below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*f_0RSsYdbJf_D9KY7TXOTg.png" /></figure><h4>Complexity:</h4><p>Space complexity: O(n)</p><p>Time complexity: O(nlogn)</p><h4>Stability:</h4><p><strong>if (left[i] &lt;= right[j]) </strong>— this line making it as stable sorting algorithm<br>Stable — Yes, it is a stable sorting algorithm</p><h4>Second method — In place sorting algorithm</h4><p>Here we’re not using extra spaces, instead we’ll pass the indexes in the argument.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*QF3sBCm2Gha6xaFSZ-Ftvg.png" /></figure><p>We only pass the indexes in the argument, base condition end == start</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*nTqX-8zWKBf3vOyW8jsWDw.png" /></figure><ul><li>Only here we took extra space <strong>int[] mix, </strong>for sorting</li><li>We put back to the original array by arr[start + l], here we use start + l because, l starts from 0 and we gonna the sort for the particular indices — start to end.</li></ul><h4>Complexity:</h4><p>Space complexity: O(n) auxiliary space meaning extra space</p><p>Time complexity: O(nlogn)</p><h4>Stability:</h4><p>if (left[i] <strong><em>&lt;=</em> </strong>right[j])<strong> </strong>— this line making it as stable sorting algorithm<br>Stable — Yes, it is a stable sorting algorithm</p><h3>QUICK SORT</h3><p>Goal is to put the pivot element in the correct position</p><ol><li>We’ll first take the <em>pivot</em> (it can be any random num), but here we gonna take mid as pivot.</li><li>First half should be less than pivot and second half should be greater than pivot.</li></ol><h4>How it works:</h4><ol><li>We’ll take the <strong>start</strong> element as <em>low</em> and <strong>end</strong> element as <em>high</em> <br>(Start, End, Low, High)</li><li>Keep the high and low as it is and start and end will be works as a pointer variable.</li><li>Until the end &lt; start we’ll compare, whether the index element is greater or smaller with pivot element. If it is so we’ll keep moving both and do the swapping things as below</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*pW5Ro7GmYJFNK9xmKWePSw.png" /></figure><p>4. Passing the low as low and end as high — first half</p><p>5. Passing the start as low and high as high — second half</p><h4>Complexity:</h4><p>Space complexity: O(n) — recursion takes space</p><p>Time complexity:<br>Best complexity: O(nlogn)<br>worst complexity: O(n²)</p><h4><strong>Stability:</strong></h4><p>Stable — No, it is a unstable sorting algorithm</p><h3>HYBRID SORTING ALGORITHM(Tim sort)</h3><p>Merge sort + Insertion sort</p><p>Insertion sort - works really well with partially sorted data</p><p>Internal sorting algorithm is much more efficient — using <strong>Dual Quick Sort, Insertion sort, Heap sort</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*GSwND4wOcEfg2PnLyCaFHg.png" /></figure><h4>Complexity:</h4><p>Space complexity: O(logn) — recursion takes space</p><p>Time complexity:<br>Best complexity: O(nlogn)<br>worst complexity: O(n²)</p><h4>Stability:</h4><p>Stable — No, it is a unstable sorting algorithm</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d5f732734fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git and GitHub]]></title>
            <link>https://medium.com/@ishavenkadesh03/git-and-github-fcc8a7ac204c?source=rss-4e76f2e8586c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fcc8a7ac204c</guid>
            <category><![CDATA[git-and-github]]></category>
            <dc:creator><![CDATA[Ishavenkadesh]]></dc:creator>
            <pubDate>Fri, 06 Feb 2026 19:54:11 GMT</pubDate>
            <atom:updated>2026-02-06T19:54:11.968Z</atom:updated>
            <content:encoded><![CDATA[<p>Commands</p><ul><li>ls — listing all files and folder inside the current directory</li><li>mkdir — creating new folder (mkdir folder)</li><li>cd — changing directory (cd folder — going inside folder)</li><li>git init — initializing git repository</li><li>ls -a — show all the hidden files (.files will be hidden)</li><li>ls .git — shows all hidden files inside .git</li><li>touch — to create new file(touch names.txt)</li><li>git status — to know status of the project</li></ul><p>three stages:<br>Untracked<br>Stagged — git add .<br>Committed — git commit -m “commit message”</p><ul><li>git add . — moving uncommitted files to staging</li><li>git add names.txt — staging the particular file(but it will show like yet to commit)</li><li>git commit -m “message” — committing the staged file</li><li>git restore(space)— — staged names.txt<br>- this will restore to the previous stagged version</li><li>git log — to find history<br>- press ‘:q’ to exit the logs</li><li>rm names.txt — to remove file</li><li>git reset f4954ce65fØØ456Øff74be8225763e31b41a9869 — to go back to the version we want in git<br>- we can remove the commit which we have done previously and it bring back to the stagged state<br>- if we don’t want from commit 3, we have to give git reset commit 2 code</li><li>git stash — will make code move to backstage, whenever needed can take but it won’t be committed</li><li>git stash pop — bring back stage to front stage</li><li>git stash clear — removing files or folders from backstage</li><li>git push origin branchName</li><li>git pull origin branchName</li></ul><h4>NOTES:</h4><p>Our account — origin url<br>Project we’re fork — upstream url</p><p>// create different branches for different features because there only <em>one pull request</em> can be made for one branch until it is merged.</p><ul><li>git push origin branchName -f — this force push is used when the online repo has the commits and our repo not, then this force is needed</li><li>git push origin branchName</li></ul><h4>Connecting project with GitHub</h4><ul><li>git remote add origin URL — to add project to GitHub<br>- git — just git command<br>- remote — url<br>- add — adding new URL<br>- origin — name of the url we gonna add</li><li>git remote -v — to get all the git url attached to this project</li><li>git push origin branchName — pushing code to GitHub branch</li><li>git branch newBranchName— to create new branch(make sure the master or main branch is upto-date before creating new branch)</li><li>git checkout newBranchName— head is pointing towards this new branch</li><li>For each feature create new branches so that pull request will be organized, if we gonna give multiple commit for different feature, while pulling everything will be merged as one commit.<br>ONE BRANCH — ONE PULL REQUEST</li></ul><h3>To merge</h3><p>step 1: checkout to the main branch(branch where we have to merge)<br>step 2: git merge branchName(branch to merge)<br>clear conflict, if present then merge</p><h4>Cloning project</h4><ul><li>first fork the project (getting other source project to your acc)</li><li>git clone url</li><li>git remote add origin URL — this is our branch</li><li>git remote add upstream url — (link of original project, to get the original project linked to our project folder)</li><li>git fetch (space) — — all (space) — — prune (to get the updated code of original upstream branch)</li></ul><h4>Methods to pull commits from upstream to origin</h4><p>Method 1: Button</p><ul><li>Click Fetch upstream button</li></ul><p>Method 2:</p><ul><li>Step 1: git checkout originMainBranch</li><li>Step 2: git pull upstream mainBranchName</li><li>Step 3: git push origin main</li></ul><p>Method 3:</p><ul><li>Step 1: git checkout originMainBranch</li><li>Step 2: git fetch (space) — — all (space) — — prune</li><li>Step 3: git reset (space) — — hard upstream/main — resetting main branch of origin as same as main branch of upstream -&gt; pulling updated code from upstream branch</li><li>Step 4: git push origin main</li></ul><h4>Squashing the commits</h4><ul><li>merging lot of commits into one commit<strong><br>. </strong>git rebase -i commitID — it shows pick, we have to pick or squash by changing the pick to s(squash), where the pick will be the commit and the squash will get merged.<br>. to exit -&gt; esc + :x<br>. git reset commitID — bring all the files above that in stagging then we can commit as a single commit— alternative method<br>. git reset commitID(space) — — hard — this will delete permanently, even in stagging will get deleted.</li></ul><h4>Editing file using Vim</h4><p>step 1: vi names.txt<br>step 2: insert<br>step 3: edit the things u want<br>step 4: to close -&gt; esc + :x</p><p><strong>Viewing the content in the file</strong><br>cat names.txt</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fcc8a7ac204c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Walmart Interview Preparation]]></title>
            <link>https://medium.com/@ishavenkadesh03/walmart-interview-preparation-ad3b466a0bfd?source=rss-4e76f2e8586c------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad3b466a0bfd</guid>
            <dc:creator><![CDATA[Ishavenkadesh]]></dc:creator>
            <pubDate>Wed, 14 Jan 2026 14:49:40 GMT</pubDate>
            <atom:updated>2026-03-25T02:24:20.031Z</atom:updated>
            <content:encoded><![CDATA[<h3>Links for future references(SDE 2):</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyI4yBNZL1do%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyI4yBNZL1do&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyI4yBNZL1do%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff7c7861a8984946efae72789b6966f2/href">https://medium.com/media/ff7c7861a8984946efae72789b6966f2/href</a></iframe><ul><li><a href="https://neetcode.io/practice/practice/neetcode150">NeetCode 150 - Coding Interview Questions</a></li><li><a href="https://takeuforward.org/dsa/strivers-a2z-sheet-learn-dsa-a-to-z">Strivers A2Z DSA Course/Sheet - Crack Any FAANG or PBCs</a></li><li><a href="https://www.linkedin.com/posts/pawan-jindal_interviewexperience-walmart-softwareengineering-activity-7363613115667632128-78e7/">Walmart SDE-2 Interview Experience: Coding, Design, and Leadership | Pawan Jindal posted on the topic | LinkedIn</a></li><li><a href="https://medium.com/@sanghamitrahota/interview-experience-of-walmart-30189ae69764">Interview Experience of Walmart</a></li><li><a href="https://www.geeksforgeeks.org/interview-experiences/walmart-interview-experience-for-sde-2-2/">Walmart Interview Experience for SDE 2 - GeeksforGeeks</a></li><li><a href="https://blog.stackademic.com/walmart-java-developer-interview-heres-what-they-asked-ab76b1e3af40">Walmart Java Developer Interview - Here&#39;s What They Asked</a></li><li><a href="https://medium.com/javarevisited/walmart-java-developer-interview-what-they-asked-part-2-f5c321479cf1">Walmart Java Developer Interview — What They Asked (Part 2)</a></li><li><a href="https://medium.com/coding-odyssey/walmart-java-developer-interview-53a71f13c1eb">Walmart Java Developer Interview</a></li><li><a href="https://blog.stackademic.com/walmart-java-interview-questions-that-almost-broke-my-brain-part-1-d4837466d110">Walmart Java Interview Questions That Almost Broke My Brain (Part-1)</a></li><li><a href="https://blog.stackademic.com/walmart-java-developer-interview-part-2-370fd7ded069">Walmart Java Developer Interview (Part 2)</a></li><li><a href="https://www.naukri.com/code360/interview-experiences/walmart/walmart-interview-experience-on-campus-aug-2022">Code 360 by Coding Ninjas</a></li></ul><h3>Topics to cover:</h3><ul><li>DSA</li><li>Java fundamentals (multithreading, OOPs)</li><li>System Design(HLD/LLD)</li><li>Spring Boot</li><li>Behavioral</li></ul><h3>Rounds:</h3><p>Round 1: <strong>DSA Coding, 2 prblms(45–60 mins)— pass all edge cases, analyzing prblm, efficiency and change the prblm statements in mid-way<br>Round 2: System Design + Coding (1 hr) — scalability, design choice, resilient<br>Round 3: Hiring Manager Round (60 mins) — past project, conflicts faced, ownership</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad3b466a0bfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>