From 5bf6b54bf7575bb7ab4d0914aa2989f6658ddb45 Mon Sep 17 00:00:00 2001 From: YogeshKarthik <88962940+YogeshKarthik@users.noreply.github.com> Date: Sun, 13 Nov 2022 13:26:59 +0530 Subject: [PATCH] Update selection_sort.cpp The code works fine even without the current variable. --- 03 Basic Sorting /selection_sort.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/03 Basic Sorting /selection_sort.cpp b/03 Basic Sorting /selection_sort.cpp index eafb41d..69832dc 100644 --- a/03 Basic Sorting /selection_sort.cpp +++ b/03 Basic Sorting /selection_sort.cpp @@ -6,7 +6,7 @@ void selection_sort(int a[],int n){ for(int pos = 0; pos <= n-2; pos++){ - int current = a[pos]; + int min_position = pos; //find out the element @@ -35,4 +35,4 @@ int main(){ } return 0; -} \ No newline at end of file +}