摘要:
采用二维数组来求解,只返回长度 int lcs(string s1,int n,string s2, int m) { int result = 0; vector<vector<int>> c(n+1,vector<int> (m+1,0)); for (int i = 1; i < n+1; i 阅读全文
摘要:
Best Time to Buy and Sell Stock I 给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。 如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个算法来计算你所能获取的最大利润。 注意你不能在买入股票前卖出股票 示例 1: 示例 2: 买卖股票的最佳 阅读全文
摘要:
在路径 ~/ns-2.34/indep-utils/cmu-scen-gen/setdest下运行 注意两点: setdest产生的文件用到了node_数组变量和god_变量 ,这里要在提出了文件中给出: can't read "god_": no such variable while execu 阅读全文