Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:
其他好文 时间:
2014-07-31 16:08:26
阅读次数:
283
解法:用栈,注意栈的用法和switch的用法 1 class Solution { 2 public: 3 bool isValid(string s) { 4 5 stack istack; 6 string::iterator p=s.b...
分类:
其他好文 时间:
2014-07-31 12:12:46
阅读次数:
229
Multi-processor systems are often implemented using a common system bus as the communication mechanism between CPU, memory, and I/O adapters. It is al...
分类:
其他好文 时间:
2014-07-31 02:17:25
阅读次数:
432
题目:Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all suc....
分类:
编程语言 时间:
2014-07-30 03:19:32
阅读次数:
341
if ((object_id('tgr_valid_data', 'TR') is not null)) drop trigger tgr_valid_datagocreate trigger tgr_valid_dataon studentafter insertas declare ...
分类:
数据库 时间:
2014-07-29 12:36:56
阅读次数:
330
LeetCode: Reverse Words in a String:Evaluate Reverse Polish NotationEvaluate the value of an arithmetic expression in Reverse Polish Notation.Valid op...
分类:
其他好文 时间:
2014-07-27 23:32:59
阅读次数:
262
题目:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or anothe....
分类:
编程语言 时间:
2014-07-26 14:14:35
阅读次数:
225
题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the....
分类:
编程语言 时间:
2014-07-26 09:55:27
阅读次数:
204
题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in t....
分类:
编程语言 时间:
2014-07-26 09:53:27
阅读次数:
254
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["255.2...
分类:
其他好文 时间:
2014-07-26 00:05:16
阅读次数:
301