https://leetcode.com/problems/regular-expression-matching/description/ Implement regular expression matching with support for '.' and '*'. 字符串匹配。最后一个样 ...
分类:
其他好文 时间:
2017-09-01 23:10:59
阅读次数:
403
1.从使用目的来看: 接口只是一个类间的协议,它并没有规定怎么去实现; 抽象类可以重用你代码使你的代码更加简洁;2.从行为来看: 接口可以多继承,multi-implement 抽象类不能实例化,必须子类化才能实例化;3.从属性来看: 接口的属性必须是常量;即public static final; ...
分类:
其他好文 时间:
2017-08-31 12:49:36
阅读次数:
157
We can avoid more duplicate work by check [0, haystack - needle + 1] length. Need to revisit KMP ...
分类:
其他好文 时间:
2017-08-30 15:45:52
阅读次数:
91
Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (including ...
分类:
其他好文 时间:
2017-08-29 12:59:04
阅读次数:
169
#include #include class myApp : public wxApp { public: bool OnInit(void); int OnExit(void); }; IMPLEMENT_APP(myApp) bool myApp :: OnInit(){ int max = ... ...
分类:
其他好文 时间:
2017-08-27 22:28:34
阅读次数:
185
#include<stdio.h> #include <string.h> int strstrcount( char *str1, char *str2 ) { char *str = str1; int c = 0; while( (str = strstr( str, str2 )) != N ...
分类:
其他好文 时间:
2017-08-19 20:01:53
阅读次数:
116
strstr(str1,str2) 函数用于判断字符串str2是否是str1的子串。如果是,则该函数返回str2在str1中首次出现的地址;否则,返回NULL。 实例: ...
分类:
其他好文 时间:
2017-08-18 21:25:59
阅读次数:
129
这个还是有点小麻烦的,我自己写的实现效果不太好,代码也很糟,然后查资料看到了比较好的算法(有的是直接用C库函数strstr),放在这里记录一个。 ...
分类:
其他好文 时间:
2017-08-18 17:18:38
阅读次数:
172
LeetCode上面的一道题目。原文例如以下: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue.pop() -- Removes th ...
分类:
其他好文 时间:
2017-08-18 11:10:19
阅读次数:
110
翻译 用队列来实现栈的例如以下操作。 push(x) —— 将元素x加入进栈 pop() —— 从栈顶移除元素 top() —— 返回栈顶元素 empty() —— 返回栈是否为空 注意: 你必须使用一个仅仅有标准操作的队列。 也就是说,仅仅有push/pop/size/empty等操作是有效的。 ...
分类:
其他好文 时间:
2017-08-18 09:39:28
阅读次数:
209