longest nondecreasing subsequence in O(nlgn)

前端 未结 5 1952
无人及你
无人及你 2021-01-06 04:07

I have the following algorithm which works well

I tried explaining it here for myself http://nemo.la/?p=943 and it is explained here http://www.geeksforgeeks.org/lon

5条回答
  •  醉话见心
    2021-01-06 04:28

    Just apply the longest increasing sub-sequence algorithm to ordered pair (A[i], i), by using a lexicographic compare.

提交回复
热议问题