Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void swap(double* a, double* b)
- {
- double pomoc = *a;
- *a = *b;
- *b = pomoc;
- }
- void babelkowe(double* t)
- {
- int i,j;
- for(i = 0; i < N - 1; i++)
- {
- for(j = 0; j < N - 1; j++)
- {
- if(t[j] > t[j+1])
- {
- swap(&t[j],&t[j+1]);
- }
- }
- }
- }
- // bez neipotrzevnych przebiegow petli
- void bubbleSort(double* t)
- {
- int c,d;
- for (c = 0 ; c < ( N - 1 ); c++)
- {
- for (d = 0 ; d < N - c - 1; d++)
- {
- if (t[d] > t[d+1])
- {
- swap(&t[d],&t[d+1]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement