DATA Structure
DATA Structure
1.Write a program that places element of an unsorted array user define array
in ascending order using BubbleSort Algorithm
#include <stdio.h>
int i, j, temp;
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
}
int main()
scanf("%d", &n);
scanf("%d", &arr[i]);
bubbleSort(arr, n);
return 0;
#include <stdio.h>
int i, j, temp;
temp = arr[j];
arr[j] = arr[j+1];
arr[j+1] = temp;
int main()
int n = sizeof(arr)/sizeof(arr[0]);
bubbleSort(arr, n);
return 0;