SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 132 forks source link

Added SemiSort_2 #372

Closed Parul1923 closed 2 years ago

Parul1923 commented 2 years ago

Issue Id you have worked upon -

191

Briefly explain your program logic -

Store even index elements of array in a vector named as even and odd index array elements in a separate vector named as odd. Sort both the vectors in ascending order. Then start iterating the array index from 0 to n-1 and for each even index store the element from start of even vector and for each odd index store the element from the end of odd vector.

Screenshots(Attach 2 screenshots of your own input and output) -

Screenshot (6)


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -