Algorithm : Two ways.
1. LCS with one array - being input array a[]; second array - sort input array b[];
So complexity = nlogn (for sort) + DP
2. Another approach
Algorithm: http://www.algorithmist.com/index.php/Longest_Increasing_Subsequence
Impl: http://www.algorithmist.com/index.php/Longest_Increasing_Subsequence.c
Everyday Utils
-
- Quick way to read contents from a file:
http://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file
http://st...
11 years ago
No comments:
Post a Comment