摘要: 思路:前缀树来存储字符串的所有前缀。 1. 状态转移方程: 2. 计算顺序 阅读全文
posted @ 2019-08-15 18:54 爱学英语的程序媛 阅读(444) 评论(0) 推荐(0) 编辑
摘要: 动态规划解法:O(n^2) class Solution { public: int lengthOfLIS(vector<int>& nums) { if(nums.empty()) return 0; int n = nums.size(); int f[n], res = 0; for(int 阅读全文
posted @ 2019-08-15 15:28 爱学英语的程序媛 阅读(235) 评论(0) 推荐(0) 编辑