Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void BubbleSort(int Arr[], int size)
- {
- bool swapped;
- do {
- swapped = false;
- for (int j=0;j<size-1;j++)
- if (Arr[j]>Arr[j+1]) {
- int temp = Arr[j];
- Arr[j] = Arr[j+1];
- Arr[j+1] = temp;
- swapped = true;
- }
- } while (swapped);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement