<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sorting Archives -</title>
	<atom:link href="https://mitindia.in/tag/sorting/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/sorting/</link>
	<description></description>
	<lastBuildDate>Sat, 31 Dec 2016 06:03:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>sorting Archives -</title>
	<link>https://mitindia.in/tag/sorting/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Sorting technique</title>
		<link>https://mitindia.in/sorting-technique/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Wed, 14 Dec 2016 12:16:53 +0000</pubDate>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[sorting]]></category>
		<category><![CDATA[sorting technique]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=644</guid>

					<description><![CDATA[<p>Sorting Techniques Sorting is a process to arrange the records in the file in an order(either ascending or descending) with respect to the key. Sorting can be divided into two types of categories called internal and external sorting based on location of records at the time of sorting. The characteristics of sorting methods are – [&#8230;]</p>
<p>The post <a href="https://mitindia.in/sorting-technique/">Sorting technique</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Sorting Techniques</h3>
<hr />
<p><strong><em>Sorting is a process to arrange the records in the file in an order(either ascending or descending) with respect to the key.</em></strong></p>
<p><strong><em>Sorting can be divided into two types of categories called internal and external sorting based on location of records at the time of sorting.</em></strong></p>
<p><strong> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- mylink -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-1696390399604457"
     data-ad-slot="7690934410"
     data-ad-format="link"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></strong></p>
<p><strong><em>The characteristics of sorting methods are – Data Sensitivity, Stability, Storage Requirements, Efficiency</em></strong></p>
<h4><span style="color: #ff0000;"><strong>Characteristics of Sorting methods</strong> </span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</h4>
<ul>
<li><strong><em>Data Sensitiveness</em></strong></li>
<li><strong><em>Stability</em></strong></li>
<li><strong><em>Storage Requirements </em></strong></li>
<li><strong><em>Efficiency</em></strong></li>
</ul>
<figure id="attachment_645" aria-describedby="caption-attachment-645" style="width: 300px" class="wp-caption alignright"><img fetchpriority="high" decoding="async" class="size-medium wp-image-645" src="http://www.mitindia.in/wp-content/uploads/2016/12/ds-300x211.png" alt="Sorting technique" width="300" height="211" srcset="https://mitindia.in/wp-content/uploads/2016/12/ds-300x211.png 300w, https://mitindia.in/wp-content/uploads/2016/12/ds-249x175.png 249w, https://mitindia.in/wp-content/uploads/2016/12/ds.png 635w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-645" class="wp-caption-text">Sorting technique</figcaption></figure>
<p><em><span style="color: #000000;"><strong>Data Sensitiveness: </strong></span></em>The sorting methods for which the time to sort an array depends on the order in which the elements appear in the original array (i.e., Sorted or Unsorted). are called Data Sensitive Methods.</p>
<p><strong><em>Stability</em></strong>: Methods that preserve the original ordering of elements are called stable methods.</p>
<p><em><strong>Storage requirements</strong></em>: Minimal storage sorting methods are those methods that use minimal storage space by rearranging the elements with the space occupied by the original array.</p>
<p><strong><em>Efficiency</em></strong>: Efficiency is the tome required to the array by any sorting method depending upon the number of comparisons required for that sorting method.</p>
<p><span style="color: #ff0000;"><strong>Types of Sorting</strong> </span><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong><em>1. Bubble sort</em></strong><br />
<strong><em>2. Selection sort </em></strong><br />
<strong><em>3. Quick sort</em></strong><br />
<strong><em>4. Insertion sort</em></strong><br />
<strong><em>5. Merge sort</em></strong><br />
<strong><em>6. Heap sort</em></strong><br />
<em><strong>Bubble sort</strong></em>: This method works according to exchange sort technique,where the records are physically interchanged within the file according to their key values<br />
Bubble sort is data sensitive. The number of checking required may be anything between 1 to (n-1) where ‘n’ denotes the number of elements in the array.</p>
<p><em><strong>Quick sort</strong></em>: Fast method of internal sorting. Uses divide and conquer method of sorting</p>
<p><em><strong>Insertion sort</strong></em>: Compares the elements of the array in the growing order successively.</p>
<p>Two variations of this insertion</p>
<p><em><strong>Shuttle sort</strong></em> – Requires (n-1)rounds of checking if there are n elements in the array</p>
<p><strong><em>Shell sort</em></strong>&#8211; Similar to the shuttle sort but sorts the arrays in the ascending order.</p>
<p><strong><em>Merge Sort</em></strong>: Merging means combining two sorted arrays into single sorted array.</p>
<p><span style="color: #ff0000;"><strong>Steps in the process:</strong> </span><br />
Scan both the arrays for right to left<br />
Compare the first element of each array<br />
The above step is repeated until one array is completely empty.<br />
The remaining elements in the other array are stored in the merged array in the order as they were in.</p>
<p>Heap Sort: The value at each node in a heap (Binary tree)<br />
is larger than the value at its existing children. The root contains the largest item.</p>
<p><a href="http://www.mitindia.in/2016/12/09/data-structure-graph/" target="_blank">You can also refer data structure graph here</a></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fsorting-technique%2F&amp;linkname=Sorting%20technique" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fsorting-technique%2F&amp;linkname=Sorting%20technique" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fsorting-technique%2F&#038;title=Sorting%20technique" data-a2a-url="https://mitindia.in/sorting-technique/" data-a2a-title="Sorting technique"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/sorting-technique/">Sorting technique</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Arrays and Functions</title>
		<link>https://mitindia.in/arrays-and-functions/</link>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Tue, 05 Jul 2016 06:56:02 +0000</pubDate>
				<category><![CDATA[C Programming]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[bubble sort]]></category>
		<category><![CDATA[sorting]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=248</guid>

					<description><![CDATA[<p>Array is a structure storing elements of similar data types sequentially in memory. Subscript Array is a structure storing elements of similar data types sequentially in memory (Index) is a variable through which the elements of the array are processed. Array size is maximum number of elements an array can hold. Rules for Arrays:- An [&#8230;]</p>
<p>The post <a href="https://mitindia.in/arrays-and-functions/">Arrays and Functions</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Array is a structure storing elements of similar data types sequentially in memory.</p>
<p><i>Subscript</i> Array is a structure storing elements of similar data types sequentially in memory (Index) is a variable through which the elements of the array are processed.</p>
<p><i>Array size</i> is maximum number of elements an array can hold.</p>
<p><span style="text-decoration: underline; color: #ff0000;">Rules for Arrays:-</span></p>
<ul>
<li>An array must be declared before it is used.</li>
<li>An array name has the same rules applicable to it that are defined for variable names.</li>
<li>An array name cannot be the same as an existing variable name or constant name.</li>
<li>Array size specified in the declaration statement must be a positive integer value or a constant containing a positive integer value.</li>
<li>It is invalid to assign an array to another by using the assignment operator. For example, If num and num2 are  arrays, it is invalid to write num2 = num.</li>
</ul>
<div></div>
<div><span style="color: #ff0000;">Types of Arrays:-</span></div>
<div>
<ul>
<li>Single dimension (eg: int rollno[3] = {1,2,3}; )</li>
</ul>
<div>Single dimensional arrays can have only one dimension and are visually represented as having several rows but a single column of data.</div>
<ul>
<li>Multi dimension ( eg: int matrix_num[4][2]; )</li>
</ul>
<div>Multidimensional arrays can have more than one dimension although more than two or three are rarely used. They may consist of several rows and columns, as well as multiple dimensions.</div>
</div>
<p>&nbsp;</p>
<div><span style="color: #ff0000;">Sorting</span>:- Sorting is the process of ordering the elements in a proper order. Order can be ascending or descending, depending on the requirement.</div>
<div>
<div>
<ul>
<li>The process of arranging the elements of an array in a particular order is called sorting.</li>
<li>The elements can be sorted either in ascending order or descending order, depending on the requirements.</li>
<li>Two of the most commonly used sorting methods are bubble sort and selection sort.</li>
<li>Bubble sort is the simplest and relatively slowest of all the other techniques of sorting.</li>
</ul>
</div>
<div>
<div>Bubble sort is one of the most commonly used sorting techniques.</div>
</div>
</div>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Farrays-and-functions%2F&amp;linkname=Arrays%20and%20Functions" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Farrays-and-functions%2F&amp;linkname=Arrays%20and%20Functions" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Farrays-and-functions%2F&#038;title=Arrays%20and%20Functions" data-a2a-url="https://mitindia.in/arrays-and-functions/" data-a2a-title="Arrays and Functions"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/arrays-and-functions/">Arrays and Functions</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>PHP Array and Compressing Data</title>
		<link>https://mitindia.in/php-array-and-compressing-data/</link>
					<comments>https://mitindia.in/php-array-and-compressing-data/#comments</comments>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Sat, 18 Jun 2016 09:19:15 +0000</pubDate>
				<category><![CDATA[PHP-MySQL]]></category>
		<category><![CDATA[compressing data using php]]></category>
		<category><![CDATA[sorting]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=74</guid>

					<description><![CDATA[<p>Following example shows that use of an array to sort records in ascending and descending order using PHP program. &#60;?php $arr = array('Apple', 'Zensor', 'MITIndia'); echo "&#60;br&#62;&#60;b&#62;Without sorted values are..&#60;/b&#62;&#60;br&#62;"; echo $arr[0], "&#60;br&#62;"; echo $arr[1], "&#60;br&#62;"; echo $arr[2], "&#60;br&#62;"; echo "&#60;br&#62;&#60;b&#62;Sorted values are..&#60;/b&#62;&#60;br&#62;"; sort($arr); $len=count($arr); for($i=0; $i&#60;$len; $i++) { echo $arr[$i], "&#60;br&#62;"; } echo "&#60;br&#62;&#60;b&#62;Reverse [&#8230;]</p>
<p>The post <a href="https://mitindia.in/php-array-and-compressing-data/">PHP Array and Compressing Data</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Following example shows that use of an array to sort records in ascending and descending order using PHP program.</p>
<pre>&lt;?php
$arr = array('Apple', 'Zensor', 'MITIndia');
echo "&lt;br&gt;&lt;b&gt;Without sorted values are..&lt;/b&gt;&lt;br&gt;";

echo $arr[0], "&lt;br&gt;";
echo $arr[1], "&lt;br&gt;";
echo $arr[2], "&lt;br&gt;";

echo "&lt;br&gt;&lt;b&gt;Sorted values are..&lt;/b&gt;&lt;br&gt;";
sort($arr);
$len=count($arr);
for($i=0; $i&lt;$len; $i++)
{
echo $arr[$i], "&lt;br&gt;";
}

echo "&lt;br&gt;&lt;b&gt;Reverse sorted values are..&lt;/b&gt;&lt;br&gt;";
rsort($arr);
$len=count($arr);
for($i=0; $i&lt;$len; $i++)
{
echo $arr[$i], "&lt;br&gt;";
}
?&gt;</pre>
<p>Out put of the above program is&#8230; (function <b>sort()</b> to use display records in ascending and function <b>rsort()</b> to display in descending order.)</p>
<p><img decoding="async" class="alignnone" src="https://4.bp.blogspot.com/-cO9qYsKaoVI/Vxs5zyo6_xI/AAAAAAAABaU/ubywJHXJa2E9J-nQ47Stu7SM5BWvrIEZACLcB/s1600/arrays.JPG" alt="Array with sort" width="284" height="474" /></p>
<p>PHP Program to compress the data / text.</p>
<pre>&lt;?php
echo "&lt;h1&gt; Compress character with PHP &lt;/h1&gt;";
echo "&lt;hr&gt;";
$str="Hello World Hello WorldHello WorldHello WorldHello 

WorldHello WorldHello WorldHello WorldHello WorldHello 

WorldHello WorldHello WorldHello WorldHello WorldHello 

WorldHello WorldHello WorldHello WorldHello WorldHello 

WorldHello WorldHello WorldHello World";
 
$compressed = gzcompress($str);
echo "Original file length: ". strlen($str)."\n";
echo "Compressed size: ". strlen($compressed)."\n";
?&gt;</pre>
<p>Output of the above program is&#8230;</p>
<p><img decoding="async" src="https://1.bp.blogspot.com/-t7GmvYgIDIM/Vxs455dYN-I/AAAAAAAABaI/Au6OOPXnOP0sHGZWy-VWQLKFvfpmN61bwCLcB/s1600/compress.JPG" alt="Compress data using php function" /></p>
<p>PHP Program to display server date and time.</p>
<pre>&lt;?php
echo "Today date :", date("m/d/y");
echo "&lt;br&gt;The time is " . date("h:i:sA");
echo "&lt;br&gt;";
echo date('d-m-Y H:i');
echo "&lt;br&gt;";
?&gt;</pre>
<p>[m=month, d=day, y=year, h=hours, i=minutes, s=seconds  and A=ante meridiem]   Output of the above program is&#8230;</p>
<p><img decoding="async" src="https://2.bp.blogspot.com/-22mGBgMPgtg/Vxs5jdYbI-I/AAAAAAAABaQ/f8TAQATdh8MGWXiQj24UQn0zKAZmCtsDwCLcB/s1600/time.JPG" alt="Time and date using php" /></p>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fphp-array-and-compressing-data%2F&amp;linkname=PHP%20Array%20and%20Compressing%20Data" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fphp-array-and-compressing-data%2F&amp;linkname=PHP%20Array%20and%20Compressing%20Data" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fmitindia.in%2Fphp-array-and-compressing-data%2F&#038;title=PHP%20Array%20and%20Compressing%20Data" data-a2a-url="https://mitindia.in/php-array-and-compressing-data/" data-a2a-title="PHP Array and Compressing Data"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/php-array-and-compressing-data/">PHP Array and Compressing Data</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mitindia.in/php-array-and-compressing-data/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
