<?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 Sweekriti Pant on Medium]]></title>
        <description><![CDATA[Stories by Sweekriti Pant on Medium]]></description>
        <link>https://medium.com/@sweekriti121?source=rss-bb64a2e18fbe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*1zW9tOu0ilmOm0lD</url>
            <title>Stories by Sweekriti Pant on Medium</title>
            <link>https://medium.com/@sweekriti121?source=rss-bb64a2e18fbe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 06:21:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sweekriti121/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[LetsGrowMore Data Science Internship]]></title>
            <link>https://medium.com/@sweekriti121/letsgrowmore-data-science-internship-e677e616ee97?source=rss-bb64a2e18fbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e677e616ee97</guid>
            <dc:creator><![CDATA[Sweekriti Pant]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 09:27:29 GMT</pubDate>
            <atom:updated>2022-09-30T09:27:29.256Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently got the opportunity to participate in the one-month Virtual Internship Programme by LetsGrowMore(<a href="https://letsgrowmore.in/">https://letsgrowmore.in/</a>),(<a href="https://letsgrowmore.in/vip/">https://letsgrowmore.in/vip/</a>). It was not only a great way to put my Data Science skills into practice but was also a wonderful way to learn a lot of new things. The virtual Internship Programme at <a href="https://letsgrowmore.in/">LetsGrowMore</a> was one of the most valuable experiences I gained in September 2022. I completed two tasks during this period of internship:-</p><ul><li>Task 1: Iris Flowers Classification ML Project</li><li>Task 2: Stock Market Prediction And Forecasting Using Stacked LSTM</li></ul><p>GitHub Repo Link: <a href="https://github.com/sweekriti121/LGMVIP--DataScience">https://github.com/sweekriti121/LGMVIP--DataScience</a></p><p>I learned a lot of new things and gained practical experience during the course of this internship.</p><p>Thanks, <a href="https://www.linkedin.com/in/~amankesarwani/">Aman Kesarwani</a> Sir for this wonderful and insightful opportunity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e677e616ee97" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LetsGrowMore Internship]]></title>
            <link>https://medium.com/@sweekriti121/letsgrowmore-internship-ebd14ea5518e?source=rss-bb64a2e18fbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebd14ea5518e</guid>
            <dc:creator><![CDATA[Sweekriti Pant]]></dc:creator>
            <pubDate>Wed, 30 Mar 2022 18:16:52 GMT</pubDate>
            <atom:updated>2022-03-30T18:16:52.218Z</atom:updated>
            <content:encoded><![CDATA[<p>I recently got the opportunity to participate in the one-month Virtual Internship Programme by LetsGrowMore(<a href="https://letsgrowmore.in/">https://letsgrowmore.in/</a>),(<a href="https://letsgrowmore.in/vip/">https://letsgrowmore.in/vip/</a>). It was not only a great way to put my Web Development skills into practice but was also a wonderful way to learn a lot of new things. The virtual Internship Programme at <a href="https://letsgrowmore.in/">LetsGrowMore</a> was one of the most valuable experiences I gained in March 2022. I completed four tasks during this period of internship:-</p><ul><li>Task 1: Create a single page website using HTML, CSS, and JS</li><li>Task 2: Create a web application using create-react-app</li><li>Task 3: CREATE A REGISTRATION FORM WHOSE DATA DISPLAY IN SAME PAGE using HTML, CSS, and Js</li><li>Task 4: INTERMEDIATE LEVEL TASK CREATE A CALCULATOR using HTML, CSS, and Js</li></ul><p>GitHub Repo Link: <a href="https://github.com/sweekriti121/LETS-GROW-MORE">https://github.com/sweekriti121/LETS-GROW-MORE</a></p><p>I learned a lot of new things and experimented with new features and elements of Web Development.</p><p>Thanks, <a href="https://www.linkedin.com/in/~amankesarwani/">Aman Kesarwani</a> Sir for this wonderful and insightful opportunity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebd14ea5518e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Searching]]></title>
            <link>https://medium.com/iot-lab-kiit/searching-e5a5cd7ff1ff?source=rss-bb64a2e18fbe------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5a5cd7ff1ff</guid>
            <dc:creator><![CDATA[Sweekriti Pant]]></dc:creator>
            <pubDate>Sat, 05 Mar 2022 17:00:52 GMT</pubDate>
            <atom:updated>2022-03-05T17:00:52.298Z</atom:updated>
            <content:encoded><![CDATA[<p>Searching Algorithms are designed to check for an element or retrieve an element from any data structure where it is stored. Based on the type of search operation, these algorithms are generally classified into two categories:</p><p>● Linear Search</p><p>● Binary Search</p><blockquote><strong>Linear Search</strong></blockquote><p><strong>What is Linear Search?</strong></p><p>Linear search is a simple and most basic searching algorithm used to search any element in a list. The basic idea is to search for the required element(key) sequentially from the very beginning to the very last of the list. If the element is found at any position then the position is returned otherwise it shows a message that the element is not present.</p><p>The <strong>working of Linear search</strong> is as follows :</p><p>1. Start from the left-most index</p><p>2. Check for the key until the end</p><p>3. If the element is found return its index</p><p>4. If we reach the end of the list then print “Not Found”.</p><blockquote><strong>LINEAR SEARCH CODES</strong></blockquote><pre>/*</pre><pre>Enter the size of the array and the element to be searched for (key-say).</pre><pre>Find whether a certain element “key” is present in the array or not.</pre><pre>If the number “key” is present, then display the array positions where it is present.</pre><pre>*/</pre><pre>#include &lt;bits/stdc++.h&gt;</pre><pre>using namespace std;</pre><pre>// a function to implement the linear search and return a vector containing the positions of the element k.</pre><pre>vector&lt;int&gt; linearSearch(int arr[], int n, int k)</pre><pre>{</pre><pre>vector&lt;int&gt; ans; // It stores the positions of the required elements.</pre><pre>for (int i = 0; i &lt; n; i++)</pre><pre>{</pre><pre>if (arr[i] == k)</pre><pre>ans.push_back(i);</pre><pre>}</pre><pre>return ans;</pre><pre>}</pre><pre>// end of the linear search function</pre><pre>int main()</pre><pre>{</pre><pre>int n; // array size</pre><pre>cout &lt;&lt; “Array size: “;</pre><pre>cin &gt;&gt; n;</pre><pre>int arr[n]; // array declaration</pre><pre>cout &lt;&lt; “Enter the array elements — → “;</pre><pre>for (int i = 0; i &lt; n; i++)</pre><pre>cin &gt;&gt; arr[i];</pre><pre>int k;</pre><pre>cout &lt;&lt; “Enter the element to be searched: “;</pre><pre>cin &gt;&gt; k;</pre><pre>vector&lt;int&gt; ans = linearSearch(arr, n, k);</pre><pre>if (ans.size() == 0) // if the element is not present, vector is empty</pre><pre>cout &lt;&lt; “Element was not present”;</pre><pre>else</pre><pre>{</pre><pre>cout &lt;&lt; “Element present at positions: “;</pre><pre>for (auto i : ans)</pre><pre>{</pre><pre>cout &lt;&lt; i &lt;&lt; “ “; // prints the positions</pre><pre>}</pre><pre>}</pre><pre>return 0;<br>}</pre><figure><img alt="Ouput" src="https://cdn-images-1.medium.com/max/678/1*TBm2R0FTYjscBcE7yB-YJg.png" /></figure><p><strong>Time Complexity:</strong> O(n)</p><p><strong>Space Complexity:</strong> O(1)</p><p>Where ’n’ is the number of elements present in the list.</p><p>● <strong>Worst case scenario</strong>: If the element being searched is present at the very last or if it’s not present it takes O(n) time to complete the search.</p><p>● <strong>Best case scenario</strong>: If the element being searched is present at start then it takes only O(1) time to find it.</p><p>Let us discuss an example.</p><p>Given an array a[5] = { 5, 20 , 31, 24 ,15}</p><p>Index → 0 1 2 3 4</p><p>We have to find the element, key = 5</p><p>In this case search starts from index 0 to index 4. It finds the key at the first index.</p><p>Output — -&gt; Element present at positions: 0</p><p>Now, We have to find the element, key = 15</p><p>In this case search starts from index 0 to index 4. It finds the element at index 4.</p><p>Output — -&gt; Element present at positions: 4</p><blockquote><strong>Binary Search</strong></blockquote><p><strong>What is Binary search?</strong></p><p>Binary Search is a sorted array searching algorithm that divides the search interval to half. The goal behind binary search is to make use of the fact that the array is sorted to reduce the time complexity from O(n) to <strong>O(logn)</strong> keeping the space complexity constant i.e. <strong>O(1)</strong>.</p><p><strong>How is it optimized?</strong></p><p>When it comes to linear search we have to check every element unlike in binary search. In binary search, we just have to check the middle element and decide later on whether to go to the left or right for further checking.</p><p>The <strong>basic steps to perform Binary search</strong> are:</p><p>● Begin with an interval covering the whole array.</p><p>● If the value of the search key is less than the item in the middle of the interval, narrow the interval to the left half.</p><p>● Otherwise, narrow it to the right half.</p><p>● Repeatedly check until the value is found or the interval is empty.</p><blockquote><strong>BINARY SEARCH CODES</strong></blockquote><h4><strong>ITERATIVE APPROACH</strong></h4><pre>#include&lt;iostream&gt;</pre><pre>using namespace std;</pre><pre>//Iterative approach of Binary Search</pre><pre>int binarySearch(int a[],int l,int h,int k)</pre><pre>{</pre><pre>while(l&lt;=h)</pre><pre>{</pre><pre>int mid = l + (h — l)/2;</pre><pre>//Check if k is present at mid</pre><pre>if(a[mid] == k)</pre><pre>return mid;</pre><pre>//If k is greater, check the right half</pre><pre>if(a[mid] &lt; k)</pre><pre>l = mid + 1;</pre><pre>//If k is smaller, check the left half</pre><pre>else</pre><pre>h = mid — 1;</pre><pre>}</pre><pre>//Return -1 if element is not present in the array</pre><pre>return -1;</pre><pre>}</pre><pre>int main()</pre><pre>{</pre><pre>int h,k;</pre><pre>cout&lt;&lt;”Enter size of array: “;</pre><pre>cin&gt;&gt;h;</pre><pre>int a[h];</pre><pre>cout&lt;&lt;”Enter elements: “;</pre><pre>for(int i=0;i&lt;h;i++)</pre><pre>cin&gt;&gt;a[i];</pre><pre>cout&lt;&lt;”Enter element to be searched: “;</pre><pre>cin&gt;&gt;k;</pre><pre>int ans = binarySearch(a,0,h-1,k);</pre><pre>if(ans == -1)</pre><pre>cout&lt;&lt;”Element not present in the array”;</pre><pre>else</pre><pre>cout&lt;&lt;”Element present in the array at index “&lt;&lt;ans;</pre><pre>return 0;</pre><pre>}</pre><figure><img alt="OUTPUT" src="https://cdn-images-1.medium.com/max/619/1*bJCdOI_xyWwP4WA0_y6jBg.png" /></figure><h4><strong>RECURSIVE APPROACH</strong></h4><pre>#include&lt;iostream&gt;</pre><pre>using namespace std;</pre><pre>//Recursive approach of Binary Search</pre><pre>int binarySearch(int a[],int l,int h,int k)</pre><pre>{</pre><pre>while(l&lt;=h)</pre><pre>{</pre><pre>int mid = l + (h — l)/2;</pre><pre>//Check if k is present at mid</pre><pre>if(a[mid] == k)</pre><pre>return mid;</pre><pre>//If k is greater, check the right half</pre><pre>if(a[mid] &lt; k)</pre><pre>return binarySearch(a,mid + 1,h,k);</pre><pre>//If k is smaller, check the left half</pre><pre>else</pre><pre>return binarySearch(a,l,mid — 1,k);</pre><pre>}</pre><pre>//Return -1 if element is not present in the array</pre><pre>return -1;</pre><pre>}</pre><pre>int main()</pre><pre>{</pre><pre>int h,k;</pre><pre>cout&lt;&lt;”Enter size of array: “;</pre><pre>cin&gt;&gt;h;</pre><pre>int a[h];</pre><pre>cout&lt;&lt;”Enter elements: “;</pre><pre>for(int i=0;i&lt;h;i++)</pre><pre>cin&gt;&gt;a[i];</pre><pre>cout&lt;&lt;”Enter element to be searched: “;</pre><pre>cin&gt;&gt;k;</pre><pre>int ans = binarySearch(a,0,h-1,k);</pre><pre>if(ans == -1)</pre><pre>cout&lt;&lt;”Element not present in the array”;</pre><pre>else</pre><pre>cout&lt;&lt;”Element present in the array at index “&lt;&lt;ans;</pre><pre>return 0;</pre><pre>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*N8AS2PuyGuvGQrLAOW6Y2g.png" /></figure><p><strong>Time complexity: </strong>O(logn)</p><p><strong>Space complexity: </strong>O(1)</p><p>Where <strong>’n’ </strong>is the number of elements</p><p>● Worst case scenario: target isn’t present in the list or is at the end of the search list takes O(logn) time to find it.</p><p>● Best case scenario: target is at the middle of the search list, takes O(1) time to find it.</p><blockquote><strong>Let’s Solve an interesting problem</strong></blockquote><p><strong><em>Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value.</em></strong></p><p><strong><em>If target is not found in the array, return [-1, -1].</em></strong></p><p><strong><em>You must write an algorithm with O(log n) runtime complexity.</em></strong></p><figure><img alt="EXAMPLE" src="https://cdn-images-1.medium.com/max/467/1*IKP44amGnESS8G63FjzLuw.png" /></figure><h4><strong>Using Linear search approach</strong></h4><pre>#include &lt;bits/stdc++.h&gt;</pre><pre>using namespace std;</pre><pre>// function to find the first position</pre><pre>int firstPos(int arr[], int n, int k)</pre><pre>{</pre><pre>for (int i = 0; i &lt; n; i++)</pre><pre>{</pre><pre>if (arr[i] == k)</pre><pre>return i;</pre><pre>}</pre><pre>return -1;</pre><pre>}</pre><pre>// function to find the last position</pre><pre>int lastPos(int arr[], int n, int k)</pre><pre>{</pre><pre>for (int i = n — 1; i &gt;= 0; i — )</pre><pre>{</pre><pre>if (arr[i] == k)</pre><pre>return i;</pre><pre>}</pre><pre>return -1;</pre><pre>}</pre><pre>int main()</pre><pre>{</pre><pre>int n; // array size</pre><pre>cout &lt;&lt; “Array size: “;</pre><pre>cin &gt;&gt; n;</pre><pre>int arr[n]; // array declaration</pre><pre>cout &lt;&lt; “Enter the array elements — → “;</pre><pre>for (int i = 0; i &lt; n; i++)</pre><pre>cin &gt;&gt; arr[i];</pre><pre>int k;</pre><pre>cout &lt;&lt; “Enter the element to be searched: “;</pre><pre>cin &gt;&gt; k;</pre><pre>int first = firstPos(arr, n, k);</pre><pre>int last = lastPos(arr, n, k);</pre><pre>if (first == -1)</pre><pre>cout &lt;&lt; “Element not present”;</pre><pre>else</pre><pre>{</pre><pre>cout &lt;&lt; “First Occurence: “ &lt;&lt; first &lt;&lt; endl;</pre><pre>cout &lt;&lt; “Last Occurence: “ &lt;&lt; last;</pre><pre>}</pre><pre>return 0;</pre><pre>}</pre><p><strong>Explanation :</strong></p><p>Here we have to find the first and the last occurrence of the given element (k) in the given array.</p><p>In the function firstpos we find the first occurrence of the k by searching linearly from the very start. Similarly, in the function lastpos we find the last occurrence of the k by searching linearly from the very end. When we find the occurrence we return the index else return -1.</p><h4><strong>Using binary search approach</strong></h4><pre>#include&lt;stdio.h&gt;</pre><pre>#include&lt;stdlib.h&gt;</pre><pre>int first(int* nums, int numsSize, int target, int l, int h)</pre><pre>{</pre><pre>while ( l &lt;= h)</pre><pre>{</pre><pre>int mid = l + (h — l)/2;</pre><pre>if( (mid == 0 || nums[mid — 1] &lt; target ) &amp;&amp; nums[mid] == target )</pre><pre>return mid;</pre><pre>if(target &lt;= nums[mid])</pre><pre>h = mid — 1;</pre><pre>else</pre><pre>l = mid + 1;</pre><pre>}</pre><pre>return -1;</pre><pre>}</pre><pre>int last(int* nums, int numsSize, int target, int l, int h)</pre><pre>{</pre><pre>while (l &lt;= h)</pre><pre>{</pre><pre>int mid = l + (h — l)/2;</pre><pre>if( (mid == numsSize-1|| nums[mid + 1] &gt; target ) &amp;&amp; nums[mid] == target )</pre><pre>return mid;</pre><pre>if(target &lt; nums[mid])</pre><pre>h = mid — 1;</pre><pre>else</pre><pre>l = mid + 1;</pre><pre>}</pre><pre>return -1;</pre><pre>}</pre><pre>int* searchRange(int* nums, int numsSize, int target, int* returnSize){</pre><pre>int *arr = (int*)malloc(2*sizeof(int));</pre><pre>int f = -1, l = -1;</pre><pre>f = first(nums,numsSize,target,0, numsSize-1);</pre><pre>l = last(nums,numsSize,target,0, numsSize-1);</pre><pre>arr[0] = f;</pre><pre>arr[1] = l;</pre><pre>*returnSize = 2;</pre><pre>return arr;</pre><pre>}</pre><pre>int main () {</pre><pre>int nums[7]={5,7,7,8,8,10};</pre><pre>int numsSize = 7;</pre><pre>int returnSize;</pre><pre>int *p[2] = searchRange(nums,numsSize,target,&amp;returnSize);</pre><pre>}</pre><p>Output:- 3 4</p><p><strong>Explanation:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/1*3C8B-XpuVxQ9y0xr3qyOAg.png" /><figcaption>Explanation-1.1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/437/1*q3jUGXE07Kpy7qVjF2CocQ.png" /><figcaption>Explanation-1.2</figcaption></figure><blockquote><strong>Written by Divyansi Mishra, Anoushka Bose, Shashank Jaiswal, Sweekriti Pant</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5a5cd7ff1ff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/iot-lab-kiit/searching-e5a5cd7ff1ff">Searching</a> was originally published in <a href="https://medium.com/iot-lab-kiit">IoT Lab KIIT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>