上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 84 下一页
摘要: 问题描述:字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列。令给定的字符序列X=“x0,x1,…,xm-1”,序列Y=“y0,y1,…,yk-1”是X的子序列,存在X的一个严格递增下标序列,使得对所有的j=0,1,…,k-1,有xij=yj... 阅读全文
posted @ 2015-01-25 15:03 穆穆兔兔 阅读(1975) 评论(0) 推荐(0) 编辑
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
posted @ 2015-01-25 09:45 穆穆兔兔 阅读(341) 评论(1) 推荐(0) 编辑
摘要: 首先,演示一个错误的reverList 1 class Solution { 2 public: 3 ListNode* reverse(ListNode* root) 4 { 5 if(NULL == root) 6 ... 阅读全文
posted @ 2015-01-24 19:26 穆穆兔兔 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2015-01-23 16:24 穆穆兔兔 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 想到的就是排序,把大的放在前面,注意下面的程序,如果数字本身是0,也会加到str中,如果用while(tmp),那么就加不到str中了,这里相当于一个do while,不过个人不喜欢用do while,所以这样写29 while(1)30 {31 ... 阅读全文
posted @ 2015-01-22 15:51 穆穆兔兔 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 方法一:若是bst,中序便利后一定是有序,递增的。可以中序遍历后查看是否递增来判断 1 class Solution { 2 public: 3 bool isValidBST(TreeNode *root) { 4 5 if... 阅读全文
posted @ 2015-01-21 12:57 穆穆兔兔 阅读(161) 评论(0) 推荐(0) 编辑
摘要: dynamic 转换时的类必须有虚函数,否则会编译报错。#include using namespace std;class A{public: int a ; int b; void prt(void){std::cout (pA); cout (rA); cou... 阅读全文
posted @ 2015-01-20 13:22 穆穆兔兔 阅读(1151) 评论(0) 推荐(0) 编辑
摘要: #include using namespace std;class A{public: int a ; int b; void prt(void){std::cout prt();}因为其为静态绑定,编译时就已经制定了函数的如可地址。输出结果为:> ./a.out prt her... 阅读全文
posted @ 2015-01-20 11:34 穆穆兔兔 阅读(251) 评论(0) 推荐(0) 编辑
摘要: #include struct CloneableBase { virtual CloneableBase* clone() const = 0;};templatestruct Cloneable : CloneableBase { virtual CloneableBase* clo... 阅读全文
posted @ 2015-01-20 11:15 穆穆兔兔 阅读(178) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/zhuyf87/archive/2013/03/12/2955058.html#includeusing namespace std;class CBird{public: CBird() { cout fly(); delete pBird... 阅读全文
posted @ 2015-01-20 10:26 穆穆兔兔 阅读(729) 评论(0) 推荐(0) 编辑
上一页 1 ··· 66 67 68 69 70 71 72 73 74 ··· 84 下一页