hello there,
i have very little concept of bubble sort. This code here is not working can u explain Why?
Can anyone explain me why memory locator(&) is used in swap(line10).
Thanks in advance.
i have very little concept of bubble sort. This code here is not working can u explain Why?
Code:
#include<stdio.h> main() { int array[4]={60,88,33,40}; int j,i; for(i=0;i<4;i++) { for(j=i+1;j<4;j++) if(array[i]>array[j]) swap(&array[i],&array[j]); } printf("%d",array[i]); }
Thanks in advance.
Comment