Given a integer array, find the maximum length of ascending order sequence.
Input:
Array: {0, 1, 3, 5, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0}
Arraylength: 14
Output:
Maximum Ascending sequence length: 7
Input:
Array: {2, -2, 2, -2, 2}
Arraylength: 5
Output:
Maximum Ascending sequence length: 1
public class Answer implements GetMaxAscSequenceLengthInterface {
@Override
public int GetMaxAscSequenceLength(final int [] arr, int arrlen)
{
// WRITE YOUR CODE HERE
return 0;
}
public static void main(String [] args)
{
// write code here to test
}
}
Answer
No comments:
Post a Comment