From 9d993f1726b40cb716a25e728648fa7418d15b1a Mon Sep 17 00:00:00 2001 From: achintyatripathi <35167273+achintyatripathi@users.noreply.github.com> Date: Sun, 6 Oct 2019 15:44:07 +0530 Subject: [PATCH] SelectionSort.py this is the python 3 implementation of selection sort --- SortingAlgos/selectionSort.cpp | 46 +++++++++++----------------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/SortingAlgos/selectionSort.cpp b/SortingAlgos/selectionSort.cpp index 95d746e..d226fb3 100644 --- a/SortingAlgos/selectionSort.cpp +++ b/SortingAlgos/selectionSort.cpp @@ -1,32 +1,14 @@ -#include - -using namespace std; - -int main() -{ - int array[10]={10,30,20,100,80,70,40,60,50,90}; - int index,swapVariable; // Index stores the index of lowest value of that round - int round,j; - int arraySize=(sizeof(array)/sizeof(array[0])); - - for(round = 0; round < arraySize; round++) - { - // This loop starts from its index and goes till the end of the loop - index=round; - for(j=round+1; j < arraySize; j++) - // After the round index it searches for the index of the smallest element - { - if(array[j]