PROBLEM: Create a flowchart or psuedo code for a Java program that when given a
ID: 3549977 • Letter: P
Question
PROBLEM:
Create a flowchart or psuedo code for a Java program that when given a sequence of integers of length one or more, prints the length of the longest sorted subsequence and its starting position.
The position of the first integer is 1.
For the sequence 35, 20, 21, 22, 5, 6, 7, 8, 9, 10, the program would display the output
Max sorted subsequence length = 6 starts at 5
If there is more than one subsequence of equal maximum length, the subseqence that appears first (the one with the smallest index) is to be used for the output.
REQUIREMENTS:
The following are some sample runs:
Enter one or more integers follwed by Ctrl+Z (Windows) or Ctrl+D (Mac)
8
Max sorted subsequence length = 1 starts at 1
Enter one or more integers follwed by Ctrl+Z (Windows) or Ctrl+D (Mac)
9 26
Max sorted subseqence length = 2 starts at 1
Enter one or more integers follwed by Ctrl+Z (Windows) or Ctrl+D (Mac)
4 12 14 16 11 12 13 14 15 16 16 18 19 8 10
Max sorted subseqence length = 9 starts at 5
Enter one or more integers follwed by Ctrl+Z (Windows) or Ctrl+D (Mac)
20 19 21 6 10 11 4 5 6 3 4
Max sorted subsequence length = 3 starts at 4
Explanation / Answer
http://pastebin.com/bKfEYHyq
please let me know if you have any difficulty :)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.