DP--Longest ascending subsequence LIS (learning tree array by the way)

Three methods:
1. DP (time complexity n^2) is
relatively simple, not to mention
2. Greedy + dichotomous (O(nlogn))
1) Write a dichotomous function (or lower_bound function)
2) Each time Find the position to be inserted in the smallest known subsequence and insert
3. Tree array maintenance (O(nlogn))
is to turn each original array query in DP into a tree array query, the original array query = O(N) tree Array query=O(logN)
tree-like array learning: https://www.cnblogs.com/xenny/p/9739600.html is
quite easy, because I have seen line segment trees and suffix arrays

Guess you like

Origin blog.csdn.net/qq_42882717/article/details/100128308