From 48a163e51ab53a73c9edbb02633e6a3673865cea Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Tue, 23 Jun 2020 20:22:30 +0000 Subject: [PATCH] formatting source-code for 3a7a266ada62816c9602bfd9d5b632b80a169617 --- sorting/comb_sort.cpp | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sorting/comb_sort.cpp b/sorting/comb_sort.cpp index 00b12fcb2..e99ae9514 100644 --- a/sorting/comb_sort.cpp +++ b/sorting/comb_sort.cpp @@ -16,8 +16,8 @@ */ #include -#include #include +#include /** * @@ -71,31 +71,31 @@ void CombSort(int *arr, int l, int r) { } void tests() { - /// Test 1 - int arr1[10] = {34, 56, 6, 23, 76, 34, 76, 343, 4, 76}; - CombSort(arr1, 0, 10); - assert(std::is_sorted(arr1, arr1 + 10)); - std::cout << "Test 1 passed\n"; + /// Test 1 + int arr1[10] = {34, 56, 6, 23, 76, 34, 76, 343, 4, 76}; + CombSort(arr1, 0, 10); + assert(std::is_sorted(arr1, arr1 + 10)); + std::cout << "Test 1 passed\n"; - /// Test 2 - int arr2[8] = {-6, 56, -45, 56, 0, -1, 8, 8}; - CombSort(arr2, 0, 8); - assert(std::is_sorted(arr2, arr2 + 8)); - std::cout << "Test 2 Passed\n"; + /// Test 2 + int arr2[8] = {-6, 56, -45, 56, 0, -1, 8, 8}; + CombSort(arr2, 0, 8); + assert(std::is_sorted(arr2, arr2 + 8)); + std::cout << "Test 2 Passed\n"; } /** Main function */ int main() { - /// Running predefined tests - tests(); + /// Running predefined tests + tests(); - /// For user interaction - int n; - std::cin >> n; - int *arr = new int[n]; - for (int i = 0; i < n; ++i) std::cin >> arr[i]; - CombSort(arr, 0, n); - for (int i = 0; i < n; ++i) std::cout << arr[i] << ' '; - delete [] arr; - return 0; + /// For user interaction + int n; + std::cin >> n; + int *arr = new int[n]; + for (int i = 0; i < n; ++i) std::cin >> arr[i]; + CombSort(arr, 0, n); + for (int i = 0; i < n; ++i) std::cout << arr[i] << ' '; + delete[] arr; + return 0; }