Question: In C++, create a solution that will create a new row whenever there's a smaller number in the vector. the first integer will create a
In C++, create a solution that will create a new row whenever there's a smaller number in the vector. the first integer will create a new row, then the second integer will be compared with the first one. If its smaller it will create a new row, but if its bigger it will continue to the next one. For example, if Vector is [5,4,6,2,7,8]
it will go as:
Row 1 =5
Row 2 = 4, 6
Row 3 = 2, 7, 8
Output the number of rows created at the end.
Test with:
a) Vector A = 5, 7, 8, 3, 2, 3
b) Vector A = 9,7,3,1,9,0
use the code provided

#include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
