From 11e743e2f0e808f0642a152e0eb24760bc3ee73f Mon Sep 17 00:00:00 2001 From: Sejal Kothari <91632881+Sejzz@users.noreply.github.com> Date: Sun, 22 Oct 2023 19:20:17 +0530 Subject: [PATCH] Create selectionSort.cpp --- algorithms/selectionSort.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 algorithms/selectionSort.cpp diff --git a/algorithms/selectionSort.cpp b/algorithms/selectionSort.cpp new file mode 100644 index 00000000..afc39db7 --- /dev/null +++ b/algorithms/selectionSort.cpp @@ -0,0 +1,35 @@ +#include +using namespace std; + +void selection_sort(int a[], int n){ + +for(int i = 0; i< n; i++){ + + int min_position = i; + for(int j = i; j