Skip to content

Commit 48a163e

Browse files
github-actionsgithub-actions
github-actions
authored and
github-actions
committed
formatting source-code for 3a7a266
1 parent 3a7a266 commit 48a163e

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

sorting/comb_sort.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
*/
1717

1818
#include <algorithm>
19-
#include <iostream>
2019
#include <cassert>
20+
#include <iostream>
2121

2222
/**
2323
*
@@ -71,31 +71,31 @@ void CombSort(int *arr, int l, int r) {
7171
}
7272

7373
void tests() {
74-
/// Test 1
75-
int arr1[10] = {34, 56, 6, 23, 76, 34, 76, 343, 4, 76};
76-
CombSort(arr1, 0, 10);
77-
assert(std::is_sorted(arr1, arr1 + 10));
78-
std::cout << "Test 1 passed\n";
74+
/// Test 1
75+
int arr1[10] = {34, 56, 6, 23, 76, 34, 76, 343, 4, 76};
76+
CombSort(arr1, 0, 10);
77+
assert(std::is_sorted(arr1, arr1 + 10));
78+
std::cout << "Test 1 passed\n";
7979

80-
/// Test 2
81-
int arr2[8] = {-6, 56, -45, 56, 0, -1, 8, 8};
82-
CombSort(arr2, 0, 8);
83-
assert(std::is_sorted(arr2, arr2 + 8));
84-
std::cout << "Test 2 Passed\n";
80+
/// Test 2
81+
int arr2[8] = {-6, 56, -45, 56, 0, -1, 8, 8};
82+
CombSort(arr2, 0, 8);
83+
assert(std::is_sorted(arr2, arr2 + 8));
84+
std::cout << "Test 2 Passed\n";
8585
}
8686

8787
/** Main function */
8888
int main() {
89-
/// Running predefined tests
90-
tests();
89+
/// Running predefined tests
90+
tests();
9191

92-
/// For user interaction
93-
int n;
94-
std::cin >> n;
95-
int *arr = new int[n];
96-
for (int i = 0; i < n; ++i) std::cin >> arr[i];
97-
CombSort(arr, 0, n);
98-
for (int i = 0; i < n; ++i) std::cout << arr[i] << ' ';
99-
delete [] arr;
100-
return 0;
92+
/// For user interaction
93+
int n;
94+
std::cin >> n;
95+
int *arr = new int[n];
96+
for (int i = 0; i < n; ++i) std::cin >> arr[i];
97+
CombSort(arr, 0, n);
98+
for (int i = 0; i < n; ++i) std::cout << arr[i] << ' ';
99+
delete[] arr;
100+
return 0;
101101
}

0 commit comments

Comments
 (0)