<?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 Tankdarshan on Medium]]></title>
        <description><![CDATA[Stories by Tankdarshan on Medium]]></description>
        <link>https://medium.com/@tankdarshan365?source=rss-81a4e290bb73------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*K0ApNsKEXJwQ1MbGxdVdEQ.jpeg</url>
            <title>Stories by Tankdarshan on Medium</title>
            <link>https://medium.com/@tankdarshan365?source=rss-81a4e290bb73------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:41:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tankdarshan365/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[Asymptotic notations in analysis of algorithms…]]></title>
            <link>https://medium.com/@tankdarshan365/asymptotic-notations-in-analysis-of-algorithms-d9624004258?source=rss-81a4e290bb73------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9624004258</guid>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Tankdarshan]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 06:39:30 GMT</pubDate>
            <atom:updated>2019-09-02T06:39:30.216Z</atom:updated>
            <content:encoded><![CDATA[<p>There are so many problem around us in the world and that is solved by some efficient algorithms in computer science.so to analyze that algorithm and make it better and better is required thing in practice…</p><p>suppose somebody creates an algorithm for some data calculation and manipulation. so it is necessary to check it’s definiteness and correctness.Such as algorithm should take maximum this amount of time for any input value etc.This analysis is given by concept of asymptotic analysis.</p><p>The main idea of asymptotic analysis is to have a measure of efficiency of algorithms that doesn’t depend on machine specific constants, and doesn’t require algorithms to be implemented and time taken by programs to be compared. Asymptotic notations are mathematical tools to represent time complexity of algorithms for asymptotic analysis. The following 3 asymptotic notations are mostly used to represent time complexity of algorithms.</p><p>(1) <strong>Θ(theta) notation</strong></p><p>theta notation gives a range of output. it means your algorithm must gives an output within that range of time.we will see an output in the context of time in every notation.</p><p>The theta notation bounds a functions from above and below, so it defines exact asymptotic behavior.</p><p>A simple way to get Theta notation of an expression is to drop low order terms and ignore leading constants. For example, consider the following expression.</p><p>3n³ + 6n² + 6000 = Θ(n³)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*tswJm7zLbf0yZjUrZTlRHQ.png" /></figure><p>as you can see algorithm will take a time between upper and lower range only for any output.</p><p>mathematically it can be said that</p><p>Θ(g(n)) = {f(n): there exist positive constants c1, c2 and n0 such <br> that 0 &lt;= c1*g(n) &lt;= f(n) &lt;= c2*g(n) for all n &gt;= n0}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*PU8C3sb5gOzOHX6JUVu8vg.png" /></figure><p><strong>2) Big O Notation</strong></p><p>Big O Notation gives a upper range for any algorithm.it means algorithm should not take more time than given range by big O notation.</p><p>big O gives a upper bound of time output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/179/1*-T8RyYER_GyG0IvVjKh3nw.png" /></figure><p>mathematically it can be said that..</p><p>O(g(n)) = { f(n): there exist positive constants c and <br> n0 such that 0 &lt;= f(n) &lt;= c*g(n) for <br> all n &gt;= n0}</p><p><strong>3) Ω Notation</strong></p><p>Just as Big O notation provides an asymptotic upper bound on a function, Ω notation provides an asymptotic lower bound.</p><p>it said that algorithm will take at least some time.</p><p>mathematically it can be said that..</p><p>Ω (g(n)) = {f(n): there exist positive constants c and<br> n0 such that 0 &lt;= c*g(n) &lt;= f(n) for<br> all n &gt;= n0}.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*WmOf8XpZSy9RLjcV6xIyBw.png" /></figure><p>that’s all for asymptotic notation.</p><p>Thank you..</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9624004258" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorithm for deciding how much platform would be needed based on the train/bus traffic using…]]></title>
            <link>https://medium.com/@tankdarshan365/algorithm-for-deciding-how-much-platform-would-be-needed-based-on-the-train-bus-traffic-using-7b0c804d2645?source=rss-81a4e290bb73------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b0c804d2645</guid>
            <category><![CDATA[railways]]></category>
            <category><![CDATA[greedy-algorithms]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Tankdarshan]]></dc:creator>
            <pubDate>Sun, 01 Sep 2019 05:47:59 GMT</pubDate>
            <atom:updated>2019-09-01T05:47:59.981Z</atom:updated>
            <content:encoded><![CDATA[<h3>Algorithm for deciding how much platform would be needed based on the train/bus traffic using greedy algorithm...</h3><p>In today’s fast growing world, transportation is necessary for humans to grow rapidly.The more efficient transport system countries will have the more rapidly the country will grow.So to design a efficient transportation system,it is required to build an efficient railway station or bus stations as per traffic.</p><p>so the story is about a simple algorithm which calculates a no of platforms requires as per traffic of bus or train.</p><p>so for example below in the box,two arrays are given.one for arrival time of trains and another is for departure time of trains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*uaZfD52IYR6JTns_YwjdJA.png" /></figure><p>so algorithm will give a result 3 means we required at least 3 platforms to manage traffics at any time because at some given interval there are three trains at a time in station.so algorithm basically calculates maximum no of trains at a time on a station ever.</p><p>so the idea is to sort all time of arrival and departure and calculate total no of train at every time of arrival and departure in the station and the maximum of that will be our final result.</p><p>solution for above example is below..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*juHSmOfElGUU0BWHceJnpA.png" /></figure><p>you can see that all checks happened at a time of arrival or departure of every train and the time is sorted in order.so we will see a C program to implement this algorithm.you can use any other language for this algorithms.and we can predict no of platforms so that the station can handle maximum traffic at any time.</p><p>we will implement above example</p><p>// Program to find minimum number of platforms <br>// required on a railway station <br>#include&lt;iostream&gt; <br>#include&lt;algorithm&gt; <br>using namespace std; <br> <br>//we will define a function which Returns minimum number of platforms //required</p><p>int find_Platform(int arr[], int dep[], int n)</p><p>//here we will give a array of arrival and departue time and size of both array //as a argument to function.<br>{ <br> // Sort arrival and departure arrays <br> sort(arr, arr+n); <br> sort(dep, dep+n); <br> //here we will use library function sort for sorting array.<br> // plat_needed indicates number of platforms <br> // needed at a time <br> int plat_needed = 1, result = 1; <br> int i = 1, j = 0; <br> <br> // Similar to merge in merge sort to process <br> // all events in sorted order <br> while (i &lt; n &amp;&amp; j &lt; n) <br> { <br> // If next event in sorted order is arrival, <br> // increment count of platforms needed <br> if (arr[i] &lt;= dep[j]) <br> { <br> plat_needed++; <br> i++; <br> <br> // Update result if needed <br> if (plat_needed &gt; result) <br> result = plat_needed; <br> } <br> <br> // Else decrement count of platforms needed <br> else<br> { <br> plat_needed — ; <br> j++; <br> } <br> } <br> <br> return result; <br>} <br> <br>// Driver program to test methods of graph class <br>int main() <br>{ <br> int arr[] = {900, 940, 950, 1100, 1500, 1800}; <br> int dep[] = {910, 1200, 1120, 1130, 1900, 2000}; <br> int n = sizeof(arr)/sizeof(arr[0]); <br> cout &lt;&lt; “Minimum Number of Platforms Required = “ <br> &lt;&lt; find_Platform(arr, dep, n); <br> return 0; <br>}</p><p>the program specifically was for above example but you can modify it such that it fetches the arrival and departure time of train from user.</p><p>Above program will give output 3 which we calculated roughly before program.</p><p>the time complexity of above algorithm is O(nlogn) as it contains sorting algorithms also with nlogn complexity.</p><p><strong>return</strong> 0;</p><p>}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b0c804d2645" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>