下面的代码用于判断一个串中的括号是否匹配所谓匹配是指不同类型的括号必须左右呼应,可以相互包含,但不能交叉例如: ..(..[..]..).. 是允许的; ..(…[…)….]…. 是禁止的对于 main 方法中的测试用例,应该输出: false true false falsepublic class 括号问题 {
public static boolean isGoodBracket(St...
分类:
编程语言 时间:
2015-04-09 15:34:03
阅读次数:
164
Problem 2030 括号问题Accept: 398Submit: 753Time Limit: 1000 mSecMemory Limit : 32768 KBProblem Description给出一个字符串,其中包括3种字符: ‘(‘, ‘)’, ‘?’.其中?表示这个字符可以是’(‘也...
分类:
其他好文 时间:
2014-10-24 12:56:50
阅读次数:
187
[ 问题: ]
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
直译:给定一个字符串,该串包含字符'(', ')', '{', '}', '[', ']', 请判断它是不是有效的
The brackets must close in the correct order, "()" and "()[]{}" are al...
分类:
其他好文 时间:
2014-08-29 16:11:48
阅读次数:
195