Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use C ,not C++ Write a program to find the longest monotonic increasing sub-sequence of the given sequence. For example, given the sequence 1
Please use C ,not C++
Write a program to find the longest monotonic increasing sub-sequence of the given sequence. For example, given the sequence 1 3 54 2 6 7; the longest monotonic increasing sub-sequence is 13 56 7 by removing 4 and 2. Input is read from the text file monosequence.inp consisting of: The first line contains a single integer n which is the number of elements of the given sequence. The second line contains n integers a, a2, ., an, where a is the value of element i. Output is written to the text file monosequence.out consisting of ONLY ONE NUMBER which is the longest length of the monotonic increasing sub-sequence. Example: monosequence.inp monosequence.out 7 13 54 267 Limitation: - 1Sn s 105 Inls 106 Processing time of the proposed algorithm s 1 second Notice: The name of the source code file is monosequence.cpp or monosequence.c
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