diff --git a/October 2024/Alternate_Sorting.cpp b/October 2024/Alternate_Sorting.cpp new file mode 100644 index 00000000..a2294e5f --- /dev/null +++ b/October 2024/Alternate_Sorting.cpp @@ -0,0 +1,61 @@ +//{ Driver Code Starts +#include +using namespace std; + + +// } Driver Code Ends +class Solution { + + public: + vector alternateSort(vector& arr) { + // Your code goes here + vectorv; + for(int i=0;i arr; + string input; + getline(cin, input); + stringstream ss(input); + int number; + while (ss >> number) { + arr.push_back(number); + } + Solution obj; + vector ans = obj.alternateSort(arr); + for (int i = 0; i < ans.size(); i++) { + cout << ans[i] << " "; + } + cout << endl; + cout << "~" << endl; + } + return 0; +} + +// } Driver Code Ends \ No newline at end of file