User talk:Sindhuja00589

c sample programs
selection sort:


 * 1) include


 * 1) include

void selection;

void show;

int main {	int arr[]={3,7,8,5,3}; selection(arr); show(arr); return 0; } void selection(int *a) {	int i,j,temp; for(i=0;i<5;i++) {		for(j=i+1;j<5;j++) {			if(a[i]>a[j]) {				temp=a[i]; a[i]=a[j]; a[j]=temp; }		}	} }

void show(int *a) {	int i;	for(i=0;i<5;i++) {		printf("%d",a[i]); } }

'''

bubble sort:'''

void bubble; void show; int main {	int arr[]={3,7,8,5,3}; bubble(arr); show(arr); return 0; } void bubble(int *a) {	int i,j,temp; for(i=0;i<5;i++) {		for(j=0;j<5-i;j++) {			if(a[i]>a[j+1]) {				temp=a[i]; a[i]=a[j]; a[j]=temp; }		}	} }
 * 1) include
 * 2) include
 * 3) include

void show(int *a) {	int i;	for(i=0;i<5;i++) {		printf("%d",a[i]); } }

 insertion sort:

void insertion; void show; int main {	int arr[]={3,7,8,5,6}; insertion(arr); show(arr); return 0; } void insertion(int *a) {	int i,j,temp; for(i=0;i<4;i++) {		temp=a[i+1];//first element of array for(j=i;j>=0;j--) {			if(temp
 * 2) include
 * 3) include