leetcode
文章平均质量分 92
wenlyq
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
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)递归,先判断特殊情况根节点为空(0),...原创 2019-05-18 22:03:22 · 124 阅读 · 0 评论 -
maximum-depth-of-binary-tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.思路一:递归/** * Definition for binary tree...原创 2019-05-19 17:11:34 · 171 阅读 · 0 评论 -
single-number
题目描述Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ex...原创 2019-05-19 17:18:58 · 231 阅读 · 0 评论 -
best-time-to-buy-and-sell-stock
Say you have an array for which the i th element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy one ...原创 2019-05-24 20:39:37 · 186 阅读 · 0 评论 -
reverse-integer
题目描述Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are some good questions to ask before coding....原创 2019-05-25 16:02:22 · 151 阅读 · 0 评论
分享