carl-zk / gitalk

comments of blog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Patience Sorting | 一叶轻舟渡万江

carl-zk opened this issue · comments

commented

https://carl-zk.github.io/blog/2021/03/02/Patience-sorting/

原来叫 Patience 是因为这个排序像一个扑克牌游戏,游戏名叫“Patience”,现在流行叫“Solitaire”。可以在电脑上玩玩先。Patience sorting 最适合解决 Longest Increasing Subsequence (LIS) 问题。例如 arr = [1,3,3,8,6,7].长度为4。如何计算长度为4的 LIS 的个数呢?i = 0, arr[i] = 1 :