![](https://img-blog.csdnimg.cn/20190918135101160.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
leetcode【牛客精选】
个人练习笔记
会飞的鸡翅膀
这个作者很懒,什么都没留下…
展开
-
【leetcode2-Java】后缀表达式求值
题目描述计算逆波兰式(后缀表达式)的值 运算符仅包含"+","-","*“和”/",被操作数可能是整数或其他表达式 例如:[“20”, “10”, “+”, “30”, “*”] -> ((20 + 10) * 30) -> 900[“40”, “130”, “50”, “/”, “+”] -> (40 + (130 / 50)) -> 42示例1输入[“20”,“10”,"+",“30”,"*"]输出900思路import java.util.*;原创 2020-10-12 16:52:06 · 173 阅读 · 0 评论 -
【leetcode1-Java】minimum-depth-of-binary-tree(二叉树最小深度)
题目描述求给定二叉树的最小深度。最小深度是指树的根结点到最近叶子结点的最短路径上结点的数量。Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.思路面试树结构一般考虑dfs和bfs,此题要求深度所以用dfs。创建list来存储叶子结原创 2020-07-27 21:01:48 · 53 阅读 · 0 评论