![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 709 阅读 · 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 · 808 阅读 · 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 · 827 阅读 · 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 · 931 阅读 · 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 · 979 阅读 · 0 评论