Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started