<?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 Katariyaharshad on Medium]]></title>
        <description><![CDATA[Stories by Katariyaharshad on Medium]]></description>
        <link>https://medium.com/@katariyaharshad1999?source=rss-654cf3c6f840------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yAog3qQVZ3LVoBKW</url>
            <title>Stories by Katariyaharshad on Medium</title>
            <link>https://medium.com/@katariyaharshad1999?source=rss-654cf3c6f840------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:37:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@katariyaharshad1999/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[Deadlock Problem in OS]]></title>
            <link>https://medium.com/@katariyaharshad1999/deadlock-problem-in-os-240aa0893017?source=rss-654cf3c6f840------2</link>
            <guid isPermaLink="false">https://medium.com/p/240aa0893017</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[deadlock-avoidance]]></category>
            <category><![CDATA[deadlock-solution]]></category>
            <category><![CDATA[deadlock]]></category>
            <category><![CDATA[deadlock-in-os]]></category>
            <dc:creator><![CDATA[Katariyaharshad]]></dc:creator>
            <pubDate>Sat, 07 Jan 2023 11:47:14 GMT</pubDate>
            <atom:updated>2023-01-07T11:47:14.708Z</atom:updated>
            <content:encoded><![CDATA[<h3>Asphalt Paving Machine and Road Roller problem</h3><p>The scenario given here provides a asphalt paving machine and a road roller. Two contators build roads, hire paving machine and road roller.</p><p>If first contractors have one paving machine and another road roller at a time, road construction cannot be done at that time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*sFTWvc9YW9TjAXBTDONdoQ.jpeg" /><figcaption>Asphalt Paving Machine(X)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*Q6RGVDRRgo2M4k9_RQjAOg.jpeg" /><figcaption>road roller(y)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*xaYhxs8KcTIn6yh9kVOpjw.png" /></figure><p>if we consider provider as <strong>A</strong> with two resource <strong>x</strong> and <strong>y</strong>.<strong>B</strong> and <strong>C</strong> is contractor. If <strong>B</strong> take <strong>x</strong> and <strong>C</strong> take <strong>y,</strong> the process goes into deadlock.</p><blockquote><strong>why Deadlock is occurs?</strong></blockquote><p>Deadlock occurs when the following four conditions are present.</p><ol><li>Mutual Exclusion</li><li>Hold and Wait</li><li>No Pre-emption</li><li>Circular Wait</li></ol><p>Note: The main purpose of this article is what is the problem and its solution</p><blockquote><strong>How to handle deadlock ?</strong></blockquote><p>Deadlock is mainly handled in four ways</p><ol><li>Deadlock Prevention</li><li>Deadlock Avoidance</li><li>Deadlock Detection and Recovery</li><li>Deadlock Ignorance</li></ol><p><strong>Deadlock Prevention : </strong>Create system which voilate at least one of four necessory condition of deadlock and ensur independance from deadlock.</p><blockquote>Mutual exclusion :</blockquote><blockquote>Only one contractor can bond with a provider at a time.</blockquote><blockquote>Hold and Wait :</blockquote><blockquote>Conservative approch -&gt; Do not allocate resources to another contractor until one contractor has acquired all the required resources.</blockquote><blockquote>Do note hold -&gt; If a contractor is holding a paving machine and after some time comes to pick up a road roller, he has to first release the holding paving machine.</blockquote><blockquote>Wait time out -&gt; Any resource can be used only for a fixed period of time. It will be released after that time.</blockquote><blockquote>No pre-emption:</blockquote><blockquote>A process with a higher priority will pre-empt the resource</blockquote><blockquote>Circular wait:</blockquote><blockquote>Where the contractor is waiting for resource circular, you should number the resource</blockquote><p><strong>Deadlock Avoidance :</strong> When the first contractor has laking the paving machine and that time the second contractor needs a road roller, then first he will check the condition for deadlock,If a deadlock condition occurs then it will reject the request.Mean it is using <strong>Safety Algorithm.</strong></p><p><strong>Deadlock Detection and Recovery: </strong>Initially he will not check if there is a deadlock or not and he will directly give what is required to the contractor, if there is a deadlock at the last moment he will go to the solution.</p><p><strong>Deadlock Ignorance: </strong>Ignore the deadlock condition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=240aa0893017" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Max-Min Problem]]></title>
            <link>https://medium.com/@katariyaharshad1999/max-min-problem-e67c4dc12a03?source=rss-654cf3c6f840------2</link>
            <guid isPermaLink="false">https://medium.com/p/e67c4dc12a03</guid>
            <dc:creator><![CDATA[Katariyaharshad]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 13:38:05 GMT</pubDate>
            <atom:updated>2019-09-02T13:38:05.156Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using Divide and Conquer mathod</h4><h4>Method-1 :-</h4><p>we will divide the problem into sub-problems and find the max and min of each group, now max. Of each group will compare with the only max of another group and min with min.Array of size is n, number of comparisons …</p><ol><li>Best case =(n-1)</li><li>Worst case=2(n-1)</li></ol><h4>Method-2 :-</h4><p>It’s method in all aliment divide in 2 -2 groups.this method Learn using example are as under…</p><h4>Ex.Find the max and min in give list.</h4><p>Index: 0 1 2 3 4 5 6</p><p>Value:8 4 3 5 6 1 13</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S1X_ExAcqJknZYF-0PWjgg.jpeg" /></figure><p>Stape of Divide Mathod:-</p><ol><li>First of all value divide near by two value than find max and min value .if last in single remain one value it’s max and min both are same as it self.this value will insert in node series with value max,min and index each max , min .</li><li>All node in calculate node time how many comparision is require in each node find max and min value , it is writeing on node.</li><li>Second stape in near by two node compare by 1st node max value with 2nd node max value and same as min .final max and min value store in new node .same as all node will be find max and min than finaly create one node it is final node.</li></ol><p>If number of array index value is n than …..</p><ul><li>Best case and worst case comparision =(n-1)</li><li>Minimum no of comparison for even number</li></ul><p>→(( 3n/2 )-2)</p><ul><li>Minimum no of comparison for odd number</li></ul><p>→selling fn(( 3n/2 )-2)</p><h4>Use of max-min algoritham:-</h4><ul><li>There are many famous examples which use the Divide and Conqure strategy, for example</li></ul><ol><li>Binary search</li><li>Merge sort</li><li>Insertion sort</li><li>Quick sort etc.</li></ol><p>First approch is mainly use in this type searching and sorting tacknick.</p><h4>Reference:-</h4><ul><li>Made Easy Publication(Gate-book)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e67c4dc12a03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimal Merge Pattern]]></title>
            <link>https://medium.com/@katariyaharshad1999/optimal-merge-pattern-c59997524ad7?source=rss-654cf3c6f840------2</link>
            <guid isPermaLink="false">https://medium.com/p/c59997524ad7</guid>
            <dc:creator><![CDATA[Katariyaharshad]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 08:26:44 GMT</pubDate>
            <atom:updated>2019-09-02T08:26:44.091Z</atom:updated>
            <content:encoded><![CDATA[<p>( Example &amp; Cpp Program )</p><ul><li>Merge a set of sorted files of different length into a single sorted file. We need to find an optimal solution, where the resultant file will be generated in minimum time.</li><li>If the number of sorted files are given, there are many ways to merge them into a single sorted file. This merge can be performed pair wise.</li></ul><h4>Ex. We have a five records in sorted list our objective is make one sorted record of given five sorted records.</h4><p>File &amp; Each Records</p><p>File: x1, x2, x3, x4, x5</p><p>Records:20 15 5 11 25</p><h4>Solution:-</h4><ul><li>Optimal marge pattern use heap tree structure in background.so,</li></ul><p>How to create merge payttern using heap tree</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6cvRXDNcoCiZUqox1alcdg.jpeg" /></figure><p>Using heap tree than create optimal merge pattern</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5H9ykZ_Av9CO3YKBIswOg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YrNYcIR7b3axU0rkv7V8tw.jpeg" /></figure><p>So,Optimal merge comparision=164</p><p>When we create regulerly merge pattern it’s comparision is more so, time complexity will be increase.note use this type marge pattern.some example of wrong patter is given below….</p><h4>Approce-1:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*utRJevAbl9LiFXoNyr7yKA.jpeg" /></figure><h4>Approce-2:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IFKCIXcsh5RCXbKJj1tpew.jpeg" /></figure><h4>Optimal merge pattern program in c++.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*flYhxyMQaa1ahT7qA3QO3A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*kaRLm_7QtVCdRKGvDpO2Zg.jpeg" /></figure><h4>Reference:</h4><ul><li>www.tutorialspoint.com</li><li>Udemy(abadulbari)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c59997524ad7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>