Question: Programming language C EXERCISE 2 (subseq.c) Write a program to find the longest continuous increasing subsequence. For example, if the input is [1,3,5,4,7] The longest

Programming language C
 Programming language C EXERCISE 2 (subseq.c) Write a program to find

EXERCISE 2 (subseq.c) Write a program to find the longest continuous increasing subsequence. For example, if the input is [1,3,5,4,7] The longest continuous increasing subsequence is [1,3,51. Even though [1,3,5,7] is also an increasing subsequence, it's not a continuous one where 5 and 7 are separated by 4. If the input is [2,2,2,2,2], the longest continuous increasing subsequence is [2], its length is 1 In your program, the user will enter data ended with -1. The number of data is no more than 30. Your program should print the index range of the longest subsequence, followed by the accrual data, followed by the sequence size For example, if user enters 1 3 5 47-1, You program should print: [0.2:[1,3,5]:3 Please follow the above print format exactly. The data should be separated with . There is no comma (.) after the last number If there are multiple increasing subsequence with same length, the first one from left should be reported. Example of outputs $ ./subseq 2 2 2 2 2-1 [0..01 (21:1 $ ./subseq 1 3 547 -1 $ ./subseq 1 3 5 4 7 8 10 2 -1 [3..6]:[4,7,8,101:4 ./subseq 7 8561 3 -1 /subseq 6 5 4-1 data[0. .0] : [6] :1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!