Question: Please help write a C++ function( With only the standard libraries:iostream and vector ) , void maxinc (int *nums, int n) which accepts an integer
Please help write a C++ function(With only the standard libraries:iostream and vector) ,void maxinc (int *nums, int n) which accepts an integer array, nums, and the length of the array n,which is a positive integers. It will then prints out a single line of the maximum length increasing sequence in the input array. An increasing sequence is defined as a sequence of numbers increasing in magnitude. If multiple maximum length increasing sequences exist in the input array, then the function should print out the one with the largest total sum. The elements of the array are unique.
For example, if my input array nums = [1 5 3 2 4] and n = 5, the function will print the sequence 1, 3 ,4;
Another example: if nums = [ 7 4 3 10 33 8] and n = 6, then the function will print 7, 10 ,33.( not 4 10 33)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
