<?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>Bubble sort | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/bubble-sort/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 04:31:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>Bubble sort program in C</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/sorting/program-to-sort-the-numbers-using-bubble-sort/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/sorting/program-to-sort-the-numbers-using-bubble-sort/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 04 Dec 2008 06:09:14 +0000</pubDate>
				<category><![CDATA[C Tutorials]]></category>
		<category><![CDATA[Sorting Programs]]></category>
		<category><![CDATA[Bubble sort]]></category>
		<category><![CDATA[bubblesort demo]]></category>
		<category><![CDATA[C/C++ Programms]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[sorting demo]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[sorting methods]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=348</guid>

					<description><![CDATA[<p>Here is the program to sort the given integer in ascending order using bubble sort method. Please find the pictorial tutor of the bubble sorting. Logic :  The entered integers are stored in the array A. Here, to sort the data in ascending order, any number is compared with the next numbers for orderliness. i.e.</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/sorting/program-to-sort-the-numbers-using-bubble-sort/">Bubble sort program in C</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Here is the program to sort the given integer in ascending order using bubble sort method. Please find the pictorial tutor of the bubble sorting.</p>
<p>Logic :  The entered integers are stored in the array A. Here, to sort the data in ascending order, any number is compared with the next numbers for orderliness. i.e. first element A[0] is compared with the second  element A[1]. If forth is greater than the prior element then swapping them, else no change. Then second element is compared with third element, and procedure is continued. Hence, after the first iteration of the outer for loop, largest element is placed at the end of the array. In the second iteration, the comparisons are made till the last but one position and now second largest element is placed at the last but one position. The procedure is traced till the array length.</p>
<p>If we complement the if condition in this program, it will give out the sorted array in descending order. Sorting can also be done in other methods, like <a href="https://studentprojects.in/source-codes/software-programs/c/sorting-programs/program-to-sort-the-numbers-using-selection-sort/">selection sorting</a> and <a href="https://studentprojects.in/articles/computer-science/c-tutorials/source-codes/software-programs/c/sorting-programs/program-to-sort-the-numbers-using-insertion-sort/">insertion sorting</a>, which follows in the next pages.</p>
<figure id="attachment_1077" aria-describedby="caption-attachment-1077" style="width: 580px" class="wp-caption aligncenter"><img decoding="async" class="size-full wp-image-1077" title="Bubble sort Image Demo" src="https://studentprojects.in/wp-content/uploads/2008/12/Bubble_sort.jpg" alt="Bubble sort Image Demo" width="580" height="1510" /><figcaption id="caption-attachment-1077" class="wp-caption-text">Bubble sort Image Demo</figcaption></figure>
<p>Here is the C program to sort the numbers using Bubble sort</p>
<pre lang="cpp">#include
void main()
{
	int A[20], N, Temp, i, j;
	clrscr();
	printf(“\n\n\t ENTER THE NUMBER OF TERMS…: “);
	scanf(“%d”,&amp;N);
	printf(“\n\t ENTER THE ELEMENTS OF THE ARRAY…:”);
	for(i=0; i&lt;N; i++)
	{
		scanf(“\n\t\t%d”, &amp;A[i]);
	}
	for(i=0; i&lt;N-1; i++)
		for(j=0; j&lt;N-i;j++)
			if(A[j]&gt;A[j+1])
			{
				Temp = A[j];
				A[j] = A[j+1];
				A[j+1] = Temp;
			}
	printf(“\n\tTHE ASCENDING ORDER LIST IS…:\n”);
	for(i=0; i&lt;N; i++)
		printf(“\n\t\t\t%d”,A[i]);
	getch();
}
</pre>
<p><a href="https://studentprojects.in/wp-content/uploads/2008/12/bubl_srt.zip">Download exe and source code here.</a></p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/sorting/program-to-sort-the-numbers-using-bubble-sort/">Bubble sort program in C</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/sorting/program-to-sort-the-numbers-using-bubble-sort/feed/</wfw:commentRss>
			<slash:comments>76</slash:comments>
		
		
			</item>
		<item>
		<title>Sorting of numbers</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/sorting-of-numbers/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/sorting-of-numbers/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Tue, 04 Nov 2008 09:34:34 +0000</pubDate>
				<category><![CDATA[C Tutorials]]></category>
		<category><![CDATA[Bubble sort]]></category>
		<category><![CDATA[Insertion sort]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[graphics program]]></category>
		<category><![CDATA[demo in sorting]]></category>
		<category><![CDATA[Selection sort]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=44</guid>

					<description><![CDATA[<p>Sorting means arranging a set of data in some order. There are different methods that are used to sort the data in ascending order. Some of the  methods are Selection sort Bubble sort Insertion sort 1. Selection sort Here, to sort the data in ascending order, the 0th element is compared with all other elements.</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/sorting-of-numbers/">Sorting of numbers</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Sorting means arranging a set of data in some order. There are different methods that are used to sort the data in ascending order. Some of the  methods are</p>
<ol>
<li> Selection sort</li>
<li> Bubble sort</li>
<li> Insertion sort</li>
</ol>
<p><strong>1. Selection sort</strong></p>
<p>Here, to sort the data in ascending order, the 0th element is compared with all other elements. If it is greater than the compared element then they are interchanged. So after the first iteration smallest element is placed at the 0th position. The same procedure is repeated for the 1st element and so on. <a href="https://studentprojects.in/source-codes/software-programs/c/sorting-programs/program-to-sort-the-numbers-using-selection-sort/">Read more&#8230;</a></p>
<p><strong>2. Bubble sort</strong></p>
<p>Here, to sort the data in ascending order, 0th element is compared with the 1st element. If it is greater than the 1st element then they are interchanged else remains same. Then 1st element is compared with 2nd element and procedure is continued. So after the first iteration largest element is placed at the last position. In the second iteration, the comparisons are made till the last but one position and now second largest element is placed at the second last position. After all the iterations, the list becomes sorted. <a href="https://studentprojects.in/source-codes/software-programs/c/sorting-programs/program-to-sort-the-numbers-using-bubble-sort/">Read more&#8230;</a></p>
<p><strong>3. Insertion sort</strong></p>
<p>Here, sorting takes place by inserting a particular element at the appropriate position. To sort the element in ascending order, in first iteration,1st element is compared with the 0th element. In the second iteration 2nd element is compared with 0th and 1st element. In general, in every iteration an element is compared with all the elements before it. While comparing if it is found that the element in question can be inserted at a suitable position, then space is created for it by shifting the other element one position to the right and inserting the element at the suitable position. This procedure is repeated for all the elements in the list. <a href="../source-codes/software-programs/c/sorting-programs/program-to-sort-the-numbers-using-insertion-sort/">Read more&#8230;</a></p>
<p>In my program, you can enter 5 numbers which are to be sorted by any one of the above methods. After entering the numbers they are shown in red colour box and while comparison is done, the two elements which are compared are shown in green colour box. After sorting the elements, their permanent position is indicated by blue colour box. <a href="https://studentprojects.in/wp-content/uploads/2008/11/sort.zip">Click here to download the program</a>.</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/sorting-of-numbers/">Sorting of numbers</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c-tutorials-c-tutorials/sorting-of-numbers/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
