You are viewing a single comment's thread. Return to all comments →
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )
std::vector<int> quickSort(std::vector<int> const & _arr){ using namespace std; auto pivot = *cbegin(_arr); list<int> lst = {pivot}; for(auto it = ++cbegin(_arr); it < cend(_arr); ++it){ if(*it < pivot){ lst.emplace_front(*it); }else{ lst.emplace_back(*it); } } return vector<int>(begin(lst), end(lst)); }
Seems like cookies are disabled on this browser, please enable them to open this website
Quicksort 1 - Partition
You are viewing a single comment's thread. Return to all comments →
C++ (more at https://github.com/IhorVodko/Hackerrank_solutions , feel free to give a star :) )