标签:c++
/*StrStr
Returns the position of the first occurrence of string get in string source, or -1 if target is not part not of source.
*/
另一篇博客:http://blog.csdn.net/lionpku/article/details/46713877
有个问题叫做KMP
编程习惯、代码风格差
数组越界
for( i=0; i<source.length() - target.length(); i++ )
length( ):算法复杂度O(1)
for( i = 0; i < strlen(source) - strlen(target); i++ )
strlen( ):算法复杂度O(n)
补充常用网站:
Google: http://www.google.com
Collabedit:http://collabedit.com
Google Style Guide:https://github.com/google/styleguide
Google开源项目风格指南-中文项目:https://github.com/zh-google-styleguide/zh-google-styleguide
leetcode:https://leetcode.com
CareerCup:http://www.careercup.com/
版权声明:本文为博主原创文章,未经博主允许不得转载。
GeekBand-极客班-C++算法原理与实践-董飞-课程笔记(一)
标签:c++
原文地址:http://blog.csdn.net/lionpku/article/details/46969991