From ba549b704f2dcb1042ca308d501bb7dfd47d28f6 Mon Sep 17 00:00:00 2001 From: Chirag <42274144+Chirag161198@users.noreply.github.com> Date: Thu, 17 Oct 2019 16:46:20 +0530 Subject: [PATCH] Create selection_sort.cpp --- selection_sort.cpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 selection_sort.cpp diff --git a/selection_sort.cpp b/selection_sort.cpp new file mode 100644 index 0000000..0cd8ea4 --- /dev/null +++ b/selection_sort.cpp @@ -0,0 +1,36 @@ +#include +#include + +using namespace std; + +void selection_sort(vector &A,int N){ + int min, temp; + for(int i=0;i>N; + + vector A(N); + cout<<"Enter the elements (space separated): "; + for(int i=0;i>A[i]; + } + selection_sort(A,N); + cout<<"Sorted list: "; + for(int i=0;i