Question: 5.7 Partition Vector Into Three Sections You are to sort an array that consists only of 0, 1, 2. The strategy behind the optimal solution

5.7 Partition Vector Into Three Sections You are to sort an array that consists only of 0, 1, 2. The strategy behind the optimal solution is based on Lomuto's partition scheme for Quicksort. Your solution must be in one pass and in-place. One pass means traversing the vector only once. Do not use a second vector, or a two pass algorithm. Do not use the algorithm library Examples Input of 2010112 will result in 0011122 Input Do not read in input! There will be no input read in anymore. Going forward use the hard-coded input on the template and ensure the program works. There will be one compare output test based on the hard-coded input. The rest of the tests will be unit tests. Output Print the results from your function with a space between each integer LAB ACTIVITY 5.7.1: Partition Vector Into Three Sections 0/4 Downloadable files main.cpp Download main.cpp Load default template... Dovo 1 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
