Here is the code for [B][COLOR="Red"]Insertion Sort, Bubble Sort and Selection Sort[/COLOR][/B] [B]Insertion Sort[/B] [CODE] #include main() { int i,j,key; int a={5,2,3,4,1}; for(i=1;i<5;i++) { key=a[i]; while(i>0 && a[i-1]>key) { j=a[i]; a[i]=a[i-1]; a[i-1]=j; --i; } } int k; for(k=0;k<5;k++) {printf("%d ", a[k]);} printf("\n"); } [/CODE] [B]Bubble Sort[/B] [CODE] #include main() { int i,j,x; int a={5,2,3,4,1}; for(i=0;i<5;i++) { for(j=i+1;j<5;j++) { if(a[i]>a[j]) { x=a[i]; a[i]=a[j]; a[j]=x; } } } int k; for(k=0;k<5;k++) {printf("%d ",a[k]);} printf("\n"); }[/CODE] [B]Selection Sort[/B] [CODE] #include main() { int i,j,x,min,k; int a={5,3,2,4,1}; for(i=0;i<5;i++) { min=i; for(j=i+1;j<5;j++) { if(a[min]>a[j]) { min=j; } x=a[min]; a[min]=a[j]; a[j]=x; } } … +0 Code Snippet vbScript - A Multi-column Sort With Minimal Coding ##vbScript - A Multi-column Sort With Minimal Coding Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. A previous post dealt with sorting. The code easily handles sorting simple things like lists of words, lines of text - cases where you only had to compare two things. What about the case where you want the option to sort on an arbitrary column of data, or you want to sort on multiple columns such as by birthdate, then by last name. That becomes more difficult to code. Databases handle that with ease by allowing you to specify … +0 Hi, i want to sort divs alphabetically both asc and desc. I am using a dropdown list created by using bootstrap: and my divs i want to sort are populated with data from database:

The End.