From 0f7b4244a4d72538eb9b75969fd2a96ca68c6f4d Mon Sep 17 00:00:00 2001 From: Jagmohan Gautam Date: Fri, 25 Oct 2024 21:59:23 +0530 Subject: [PATCH] added solution for GFG_POTD_25-10-2024_Alternative_Sorting --- .../GFG_POTD_25-10-2024_Alternative_Sorting.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 october_2024/GFG_POTD_25-10-2024_Alternative_Sorting.cpp diff --git a/october_2024/GFG_POTD_25-10-2024_Alternative_Sorting.cpp b/october_2024/GFG_POTD_25-10-2024_Alternative_Sorting.cpp new file mode 100644 index 0000000..fbaa3ea --- /dev/null +++ b/october_2024/GFG_POTD_25-10-2024_Alternative_Sorting.cpp @@ -0,0 +1,17 @@ +class Solution { + public: + vector alternateSort(vector& arr) { + sort(arr.begin(),arr.end()); + int n=arr.size(); + vectorans; + int i=0,j=n-1; + while(i