From 0e40f90d6f5eb26bfabcde752cb2173c4cb23891 Mon Sep 17 00:00:00 2001 From: jajakiez <42089418+jajakiez@users.noreply.github.com> Date: Thu, 4 Oct 2018 18:50:15 +0530 Subject: [PATCH] Update bubble_sort.cpp --- bubble_sort/Cpp/bubble_sort.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bubble_sort/Cpp/bubble_sort.cpp b/bubble_sort/Cpp/bubble_sort.cpp index 7afbf06d..a162dd74 100644 --- a/bubble_sort/Cpp/bubble_sort.cpp +++ b/bubble_sort/Cpp/bubble_sort.cpp @@ -18,7 +18,7 @@ void bubble_sort(int arr[], int n) { } } - // If no two elements were swapped by inner loop, then break + // If no two elements were swapped by inner loop, then break. if (swapped == false) break; } @@ -29,11 +29,10 @@ void print_array(int arr[], int size) { int i; for (i = 0; i < size; i++) printf("%d ", arr[i]); - printf("\n"); } -// Driver program to test above functions +// Driver program to test above functions. int main() { int arr[] = {64, 34, 25, 12, 22, 11, 90}; int n = sizeof(arr) / sizeof(arr[0]);