Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int bubbleSort(int *A, int len) {
- int temp,x,y = 0;
- if (A == NULL) { return -1; }
- if (len == 1) { return 0; }
- for (x=0; x < len; x++) {
- for (y=0; y < len; y++) {
- if (A[x] < A[y]) {
- temp = A[x];
- A[x] = A[y];
- A[y] = temp;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment