Bubble Sort Explanation:
You can see the video for explanation of bubble sort.
Source Code:
#include<bits/stdc++.h>
int main()
{
int N,number[100],i,j,temp;
scanf("%d",&N);
for(i=0;i<N;i++)
scanf("%d",&number[i]);
for(i=1;i<=N-1;i++)
{
for(j=0;j<N-i;j++)
{
if(number[j]>number[j+1])
{
temp=number[j];
number[j]=number[j+1];
number[j+1]=temp;
}
}
}
printf("\nAfter Ascending order sorting, sorted values are:\n");
for(i=0;i<N;i++)
printf("%d ",number[i]);
return 0;
}
I was extremely pleased to discover this page. I want to to thank you for ones time due to this wonderful read!! I definitely appreciated every part of it and I have you bookmarked to look at new information on your web site.
Normally I do not learn post on blogs, but I wish to say that this write-up very compelled me to check out and do so! Your writing style has been amazed me. Thank you, quite great article.