
leetcode
文章平均质量分 53
牧之丶
但行好事,莫问前程。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[leetcode]Valid Parentheses题解
描述Given a string containing just the characters ’(’, ’)’, ’{’, ’}’, ’[’ and ’]’ , determine if theinput string is valid.The brackets must close in the correct order, ”()” and ”()[]” are all vali原创 2015-01-17 10:06:52 · 746 阅读 · 0 评论 -
[leetcode]Longest Valid Parentheses题解
题目:Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()",原创 2015-01-18 17:38:23 · 844 阅读 · 0 评论 -
[leetcode]Evaluate Reverse Polish Notation题解
描述Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples:["2", "1", "+", "原创 2015-01-18 22:36:22 · 851 阅读 · 0 评论 -
[leetcode]二叉树先序遍历
struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {}};//先序遍历递归版本vector result;vector preorderTraversal(TreeNode *root) { i原创 2015-02-06 16:10:11 · 975 阅读 · 0 评论 -
[leetcode]二叉树中序遍历
//中序遍历递归版本vector result;vector inorderTraversal(TreeNode *root) { if (root!=NULL) { inorderTraversal(root->left); result.push_back(root->val); inorderTraversal(root->right); } return re原创 2015-02-07 17:29:59 · 1022 阅读 · 0 评论