上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 54 下一页

2019年5月31日

摘要: problem 557. Reverse Words in a String III solution1:字符流处理类istringstream. solution2:单词首尾指针。 参考 1. Leetcode_easy_557. Reverse Words in a String III; 2. 阅读全文
posted @ 2019-05-31 09:29 鹅要长大 阅读(252) 评论(0) 推荐(0)

2019年5月30日

摘要: problem 551. Student Attendance Record I 题意: solution: 理解题意很简单,重要的是其中的逻辑怎么实现。还有一点需要注意自加自减运算,感觉还是有点不熟练。。 参考 1. Leetcode_easy_551. Student Attendance Re 阅读全文
posted @ 2019-05-30 10:05 鹅要长大 阅读(189) 评论(0) 推荐(0)

2019年5月29日

摘要: problem 543. Diameter of Binary Tree 题意: 转换一种角度来看,是不是其实就是根结点1的左右两个子树的深度之和呢。那么我们只要对每一个结点求出其左右子树深度之和,这个值作为一个候选值,然后再对左右子结点分别调用求直径对递归函数,这三个值相互比较,取最大的值更新结果 阅读全文
posted @ 2019-05-29 13:08 鹅要长大 阅读(217) 评论(0) 推荐(0)
摘要: problem 541. Reverse String II 题意: 给定一个字符串,每隔k个字符翻转这k个字符,剩余的小于k个则全部翻转,否则还是只翻转剩余的前k个字符。 solution1: solution2: 简洁版 就是每2k个字符来遍历原字符串s,然后进行翻转,翻转的结尾位置是取i+k和 阅读全文
posted @ 2019-05-29 10:29 鹅要长大 阅读(150) 评论(0) 推荐(0)
摘要: problem 538. Convert BST to Greater Tree 参考 1. Leetcode_easy_538. Convert BST to Greater Tree; 完 阅读全文
posted @ 2019-05-29 10:22 鹅要长大 阅读(146) 评论(0) 推荐(0)

2019年5月28日

摘要: problem 532. K-diff Pairs in an Array 题意:统计有重复无序数组中差值为K的数对个数。 solution1: 使用映射关系; 统计数组中每个数字的个数。我们可以建立每个数字和其出现次数之间的映射,然后遍历哈希表中的数字,如果k为0且该数字出现的次数大于1,则结果r 阅读全文
posted @ 2019-05-28 09:31 鹅要长大 阅读(193) 评论(0) 推荐(0)

2019年5月27日

摘要: //IHostMemory *gieModelStream {nullptr}; //const char* prototxt = "./googlenet/test_20181010.prototxt";//argv[1]; //const char* caffemodel = "./googlenet/lane_area_lx1890_iter_320000_20... 阅读全文
posted @ 2019-05-27 16:31 鹅要长大 阅读(223) 评论(0) 推荐(0)
摘要: problem 530. Minimum Absolute Difference in BST 参考 1. Leetcode_easy_530. Minimum Absolute Difference in BST; 2. Grandyang_二叉搜索树的最小绝对差; 完 阅读全文
posted @ 2019-05-27 14:01 鹅要长大 阅读(151) 评论(0) 推荐(0)
摘要: problem 521. Longest Uncommon Subsequence I 最长非共同子序列之一 题意: 两个字符串的情况很少,如果两个字符串相等,那么一定没有非共同子序列,反之,如果两个字符串不等,那么较长的那个字符串就是最长非共同子序列。 solution: or 参考 1. Lee 阅读全文
posted @ 2019-05-27 13:48 鹅要长大 阅读(140) 评论(0) 推荐(0)
摘要: problem 520. Detect Capital 题意: 题目中给出的三种情况,分别是全是大写、全是小写、首字母大写,这三种情况返回True;否则返回False; solution: 参考 1. Leetcode_520. Detect Capital; 完 阅读全文
posted @ 2019-05-27 13:32 鹅要长大 阅读(200) 评论(0) 推荐(0)

2019年5月26日

摘要: problem 509. Fibonacci Number solution1: 递归调用 solution2: 结果只与前两个数字有关。 solution3: 使用数组类型数据。 但是不知道哪里有问题,为什么一直没有通过。。。哪位大神看到知道原因的麻烦告知一下下哈~ 参考 1. Leetcode_ 阅读全文
posted @ 2019-05-26 12:21 鹅要长大 阅读(185) 评论(0) 推荐(0)
摘要: problem 507. Perfect Number solution: /* class Solution { public: bool checkPerfectNumber(int num) { int sum = 1; for(int i=2; i*i<=num; i++) { if(num 阅读全文
posted @ 2019-05-26 11:53 鹅要长大 阅读(183) 评论(0) 推荐(0)
摘要: problem 506. Relative Ranks solution1:使用优先队列; 掌握priority_queue 和 pair的使用; solution2: 使用映射map; 参考 1. Leetcode_506. Relative Ranks; 完 阅读全文
posted @ 2019-05-26 11:11 鹅要长大 阅读(158) 评论(0) 推荐(0)

2019年5月24日

摘要: problem 504. Base 7 solution: 参考 1. Leetcode_504. Base 7; 完 阅读全文
posted @ 2019-05-24 17:27 鹅要长大 阅读(158) 评论(0) 推荐(0)
摘要: problem 501. Find Mode in Binary Search Tree 参考 1. Leetcode_501. Find Mode in Binary Search Tree; 完 阅读全文
posted @ 2019-05-24 17:02 鹅要长大 阅读(116) 评论(0) 推荐(0)
摘要: problem 500. Keyboard Row 题意:判断给出的某个单词是否可以使用键盘上的某一行字母type得到; 注意大小写的转换; solution1: 使用set保存三行字符,查看每个字符所在的行数是否一致; SET: or: 判断每一行的字母数目是否与对应单词的长度一致; class 阅读全文
posted @ 2019-05-24 16:58 鹅要长大 阅读(251) 评论(0) 推荐(0)

2019年5月23日

摘要: Q: for i in range(len(shape)/2):TypeError: 'float' object cannot be interpreted as an integer A: for i in range(len(shape)//2): 参考 1. https://blog.csd 阅读全文
posted @ 2019-05-23 14:00 鹅要长大 阅读(1907) 评论(0) 推荐(0)

2019年5月22日

摘要: 前言 操作过程 NCNN: https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux-x86; vector初始化: int num[4] = { 1, 4, 3, 2 }; int numLength = sizeof(nu 阅读全文
posted @ 2019-05-22 15:28 鹅要长大 阅读(964) 评论(0) 推荐(0)
摘要: 前言 MTCNN是级联卷积网络,原理基本上比较清晰,只是还缺少实战,看到一个CSDN上windows的实现过程,就拿来试试。 操作过程 参考here,某些步骤会添加博主遇到的问题的解释。 参考 1. MTCNN的windows-cpu配置; 2. MTCNN_paper; 完 阅读全文
posted @ 2019-05-22 15:24 鹅要长大 阅读(762) 评论(0) 推荐(0)

2019年5月16日

摘要: 前言 使用CAN通信时将信号转换为char类型进行传输,要查看传输的信息是否正确需要将char类型数据以二进制格式输出; code 参考 1. 二进制格式输出char类型数据; 完 阅读全文
posted @ 2019-05-16 11:24 鹅要长大 阅读(1095) 评论(0) 推荐(0)
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 54 下一页

导航