We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
The DP idea works; its comlexity depends on how it's implemented.
The main idea to accelerate O(n^2) into O(nlogn) is that, among the longest increasing subsequences (LIS) of same length so far, we need only care about the LIS that ends at the smallest value, as it has the most potential to expand. This enables an O(logn) time looking up for the LIS to expand.
The Longest Increasing Subsequence
You are viewing a single comment's thread. Return to all comments →
The DP idea works; its comlexity depends on how it's implemented.
The main idea to accelerate O(n^2) into O(nlogn) is that, among the longest increasing subsequences (LIS) of same length so far, we need only care about the LIS that ends at the smallest value, as it has the most potential to expand. This enables an O(logn) time looking up for the LIS to expand.
More details was found here: http://www.capacode.com/array/longest-increasing-subsequence-in-on-log-n-time/