Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "sort.h"
- void bubble_sort(int *array, size_t size)
- {
- int temp;
- for (size_t i = 0; i < size; i++)
- {
- for (size_t j = i + 1; j < size; j++)
- {
- if (array[i] > array[j])
- {
- temp = array[i];
- array[i] = array[j];
- array[j] = temp;
- print_array(array, size);
- }
- else
- continue;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment