刷题
ZereChen
我就是我
展开
-
LeetCode111-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.给定一个二叉树,求出它的最小深度,最小深度是从根节点到最近的叶子节点的最...原创 2019-03-31 17:32:36 · 119 阅读 · 0 评论 -
LeetCode149-max-points-on-a-line
问题描述Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.求二维平面上n个点中,最多共线的点数。Input: [[1,1],[2,2],[3,3]]Output: 3Explanation:^|| o| o| ...原创 2019-04-05 19:59:43 · 127 阅读 · 0 评论 -
Leetcode107- Binary Tree Level Order Traversal II
问题描述Given a binary tree, return the postorder traversal of its nodes’ values.给定二叉树,返回层次遍历。For example:Given binary tree{1,#,2,3}, 3 / \ 9 20 / \ 15 7return its level order tr...原创 2019-04-06 13:02:52 · 123 阅读 · 0 评论 -
LeetCode150-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:用逆波兰符号计算算术表达式的值。有效的运算符为...原创 2019-04-01 18:52:00 · 135 阅读 · 0 评论 -
链表中环的入口结点
问题描述给一个链表,若其中包含环,请找出该链表的环的入口结点,否则,输出null。解题思路方法一哈希表,时间O(n),空间O(n)遍历整个链表,并将链表结点存入哈希表中(这里我们使用容器set)如果遍历到某个链表结点已经在set中,那么该点即为环的入口结点public ListNode EntryNodeOfLoop1(ListNode pHead) { if (...原创 2019-04-02 18:26:16 · 111 阅读 · 0 评论 -
LeetCode11-Container With Most Water
问题描述Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find ...原创 2019-04-03 19:29:43 · 130 阅读 · 0 评论