perlquestion
TedPride
Your job, should you choose to accept it, is to come up with an algorithm to find the longest increasing sequence of numbers in a given array in O(n lg n) time. For instance:<p>
A = {8, 6, 5, 1, 9, 3, 7, 4, 2, 10}<br>
Longest increasing sequence = {1, 3, 4, 10}<p>
A = {3, 10, 6, 1, 5, 7, 8, 2, 4, 9}<br>
Longest increasing sequence = {1, 5, 7, 8, 9}<p>
If more than one longest sequence is possible, any of the available longest sequences may be returned.<p>
Have fun!