From e24ab0aa7f254f1e4e4fef3a7a7d30ca21dfd76c Mon Sep 17 00:00:00 2001 From: beqakd Date: Fri, 12 Jun 2020 12:46:31 +0400 Subject: [PATCH] style changes --- sorting/gnome_sort.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sorting/gnome_sort.cpp b/sorting/gnome_sort.cpp index fdd79b422..8f6378e9f 100644 --- a/sorting/gnome_sort.cpp +++ b/sorting/gnome_sort.cpp @@ -4,7 +4,7 @@ * A basic implementation of gnome sort algorithm. */ -#include // for io operations +#include // for io operations /** * Copyright 2020 @author beqakd @@ -25,13 +25,13 @@ template void gnomeSort(T arr[], int size) { if (size <= 1) return; - int index = 0; // initialize some variables. + int index = 0; // initialize some variables. while (index < size) { // check for swap if ((index == 0) || (arr[index] >= arr[index - 1])) { index++; } else { - std::swap(arr[index], arr[index - 1]); // swap + std::swap(arr[index], arr[index - 1]); // swap index--; } }