希望弄懂:一. 泛型的好处二. 表述三. 的作用四. ,作为参数类型的作用五. wildcard嵌套 一. JDK1.5 引入了泛型,好处:1. 编译时,类型检查2. 避免类型转换例如,ArrayList list = new ArrayList();list.add("str1")System.o...
分类:
编程语言 时间:
2015-03-31 14:13:42
阅读次数:
170
Binary String Matching
时间限制:3000 ms | 内存限制:65535 KB
难度:3
描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as...
分类:
其他好文 时间:
2015-03-31 09:12:58
阅读次数:
122
问题描述:给定字符串s与模式串p,其p中‘.‘可以匹配s中任意字符,‘*‘可以匹配0个或者任意多个之前字符,判断模式串p是否匹配全部字符串s(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","a*")→trueisMatch("aa"..
分类:
其他好文 时间:
2015-03-31 01:03:53
阅读次数:
120
问题描述:给定字符串s与模式串p,其中p中的‘?‘可以匹配任意单个字符,‘*‘可以匹配任意字符串(包括空串),判断模式串是否匹配字符s全部(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","*")→trueisMatch("aa"..
分类:
其他好文 时间:
2015-03-31 01:03:35
阅读次数:
115
问题描述:给定字符串s与模式串p,其中p中的‘?‘可以匹配任意单个字符,‘*‘可以匹配任意字符串(包括空串),判断模式串是否匹配字符s全部(不是部分)。例子:isMatch("aa","a")→falseisMatch("aa","aa")→trueisMatch("aaa","aa")→falseisMatch("aa","*")→trueisMatch("aa"..
分类:
其他好文 时间:
2015-03-31 01:01:18
阅读次数:
149
https://leetcode.com/problems/regular-expression-matching/Implement regular expression matching with support for'.'and'*'.'.' Matches any single chara...
分类:
其他好文 时间:
2015-03-30 22:52:12
阅读次数:
220
正则表达式到底是什么东西?在编写处理字符串的程序或网页时,经常会有查找符合某些复杂规则的字符串的需要。正则表达式就是用于描述这些规则的工具。换句话说,正则表达式就是记录文本规则的代码。很可能你使用过Windows/Dos下用于文件查找的通配符(wildcard),也就是*和?。如果你想查找某个目录下...
分类:
其他好文 时间:
2015-03-30 12:41:04
阅读次数:
195
You may know that an unbounded wildcard Set can hold elements of any type, and a raw type Set can also hold elements of any type. What is the differen...
分类:
其他好文 时间:
2015-03-29 23:21:16
阅读次数:
193
题目:Wildcard Matching
/*LeetCode WildCard matching
* 题目:给定一个目标串和一个匹配串,判定是否能够匹配
* 匹配串中的定义:字符————>字符,*————>0个、1个或者多个字符,?——————>对应任意一个字符
* 思路:动态规划:*:dp[i][j] = dp[i][j-1] || dp[i-1][j]
* ? || s[i...
分类:
其他好文 时间:
2015-03-29 00:44:48
阅读次数:
172
题目‘?’ Matches any single character.
‘*’ Matches any sequence of characters (including the empty sequence).The matching should cover the entire input string (not partial).The function prototype should...
分类:
编程语言 时间:
2015-03-21 12:43:07
阅读次数:
190