mustakimur khandaker 1b252e4ba2 exercise for lab1
2022-01-29 21:38:37 -05:00

313 B

In C, a simple bubble sort application would be following:

void bubbleSort(int arr[], int n)
{
	for (int i = 0; i < n-1; i++){
		for (int j = 0; j < n-i-1; j++){
			if (arr[j] > arr[j+1]){
				int temp = arr[j];
				arr[j] = arr[j+1];
				arr[j+1] = temp;
			}
		}
	}
}

Implement the same code in Rust.