![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
栈
JohnWill_
小白一个,慢慢成长....
展开
-
逆波兰计算表达式
题目: 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", ...原创 2018-03-19 10:57:22 · 431 阅读 · 0 评论 -
二叉树后序遍历(栈)
题目:Given a binary tree, return the postorder traversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3 return[3,2,1].Note: Recursive solution is trivial, could...原创 2018-03-20 14:29:55 · 3834 阅读 · 0 评论 -
二叉树前序遍历(栈)
题目:Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3 return[1,2,3].Note: Recursive solution is trivial, could ...原创 2018-03-20 15:41:48 · 907 阅读 · 0 评论 -
simplify-path 简化路径
题目描述Given an absolute path for a file (Unix-style), simplify it. For example,path ="/home/", =>"/home"path ="/a/./b/../../c/", =>"/c"Corner Cases: Did you consider the case where path ...原创 2018-04-07 14:20:37 · 467 阅读 · 0 评论 -
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"()", whic...原创 2018-04-17 14:29:58 · 88 阅读 · 0 评论 -
Valid Parentheses
题目描述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"...原创 2018-04-18 22:54:41 · 91 阅读 · 0 评论