上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页
摘要: The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fi... 阅读全文
posted @ 2016-04-28 10:21 Free_Open 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 字母A-J,用0-9对应字母使得n组数据和最大,输入字符串前面保证非0 如输入组数据: 2 ABC BCA 输出: 1875思路:其实就是求和,对应字符乘以相应的量级,按系数排序 如上MAX(101A+110B+11C) 那B:9 A:8,C:7产生最大和 同时考虑类型为字符串涉... 阅读全文
posted @ 2016-04-27 22:39 Free_Open 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one uniq... 阅读全文
posted @ 2016-04-27 18:18 Free_Open 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 算法是内功,程序员别冷落算法! 来源:李开复,写于 2006 年 链接:http://blog.jobbole.com/99658/ 算法的力量 算法是计算机科学领域最重要的基石之一,但却受到了国内一些程序员的冷落。许多学生看到一些公司在招聘时要求的编程语言五花八门就产生了一种... 阅读全文
posted @ 2016-04-27 18:00 Free_Open 阅读(1314) 评论(0) 推荐(0) 编辑
摘要: vector::iterator int_ite; vector::iterator string_ite; //vector v(n,i)形式,v包含n 个值为 i 的元素 vector ivec(10,0); //vector v(v1)形式,v是v1 的一个副本 vec... 阅读全文
posted @ 2016-04-27 11:54 Free_Open 阅读(46032) 评论(0) 推荐(1) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters.Examples:Given “abcabcbb”, the answer is “abc”, which t... 阅读全文
posted @ 2016-04-26 13:35 Free_Open 阅读(131) 评论(0) 推荐(0) 编辑
摘要: C++ STL算法:copy 目录(?)[+] 前面十二个算法所展现的都属于非变易算法(Non-mutating algorithms)系列,现在我们来看看变易算法。所谓变易算法(Mutating algorithms)就是一组能够修改容器元素数据的模... 阅读全文
posted @ 2016-04-26 11:16 Free_Open 阅读(400) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/jerry19880126/p/3616999.html C++类内存分布 书上类继承相关章节到这里就结束了,这里不妨说下C++内存分布结构,我们来看看编译器是怎么处理类成员内存分布的,特别是在继承、虚函数存在的情况下。 工欲善其事,... 阅读全文
posted @ 2016-04-25 23:10 Free_Open 阅读(11781) 评论(0) 推荐(3) 编辑
摘要: class A {public: A() { cout#include #include #include #define IMIN numeric_limits::min()#define IMAX numeric_limits::max()#define FR(i,n) ... 阅读全文
posted @ 2016-04-25 22:55 Free_Open 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 思路:so easyclass Solution {public: string reverseString(string s) { int n = s.size(); for(int i=0;i<n/2;++i) { ... 阅读全文
posted @ 2016-04-24 23:00 Free_Open 阅读(95) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页