题目: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 onl...
分类:
其他好文 时间:
2014-05-23 12:20:50
阅读次数:
407
1. 首先安装samba服务。 2. 配置防火墙(要先关闭) 3.
创建samba服务器用户:smbpasswd -a username 删除samba服务器用户:smbpasswd -x username 4.
配置/etc/samba/smb.conf 需要配置valid user vi /et...
分类:
系统相关 时间:
2014-05-19 15:58:50
阅读次数:
279
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-05-19 07:23:48
阅读次数:
357
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
all vali...
分类:
其他好文 时间:
2014-05-18 15:11:17
阅读次数:
249
【题目】
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 all valid but "(]" and "([)]" are not.
【题意】
判断给定的字符串是否是合法的...
分类:
其他好文 时间:
2014-05-18 10:08:11
阅读次数:
327
【题目】
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n = 3, a solution set is:
"((()))", "(()())", "(())()", "()(())", "()()()"
【题意】
给定n对括号,输出所有可行的括号组合字符串。所谓合法,就是可以Valid Pare...
分类:
其他好文 时间:
2014-05-18 09:06:41
阅读次数:
266
【题目】
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
【题意】
合并K个有序链表
【思路】
归并
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For ...
分类:
其他好文 时间:
2014-05-18 09:05:40
阅读次数:
255
题意:
Evaluate the value of an arithmetic expression in
Reverse Polish Notation.
Valid operators are +, -, *,
/. Each operand may be an integer or another expression.
So...
分类:
其他好文 时间:
2014-05-18 08:09:15
阅读次数:
190
1、gem安装出现下面错误
root@ubuntu:/home/git/gitlab# sudo gem install bundler --no-ri --no-rdoc
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https...
分类:
其他好文 时间:
2014-05-15 18:19:48
阅读次数:
304
题意:给定数字n,生成所有可能的n对括号的组合
思路:dfs暴力枚举
当左括号出现的次数 < n 的时候,可以选择放置新的左括号
当右括号出现的次数 < 左括号的次数的时候,可以选择放置新的右括号
递归函数:
void generateparenthesis(int n, int left, int right, vector& result)
表示将生成的所有可能的n对括号的组合放到result中,
其中,
s表示已生成的部分括号,
left表示当前的左括号数,
right表示当前的右括号...
分类:
其他好文 时间:
2014-05-15 13:21:12
阅读次数:
311