今際の国の呵呵君
Wednesday, September 13, 2017
[LeetCode]Increasing Subsequences
很直观的backtracking类的题目,不需要多讲,要注意去重。关于去重的思路可以参考
Permutations II
。时间复杂度O(k),k为IS(Increasing Subsequences)的数量,空间复杂度O(d),d为最长的IS。代码如下:
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment