- 博客(9)
- 资源 (2)
- 收藏
- 关注
原创 leetcode121-python 买卖股票最佳时机
Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), d...
2018-07-07 17:51:06 353
原创 leetcode-118 python 杨辉三角
Given a non-negative integer numRows, generate the first numRows of Pascal's triangle.In Pascal's triangle, each number is the sum of the two numbers directly above it.Example:Input: 5Output:[ ...
2018-07-05 21:03:18 404
原创 leetcode112-python 路径总和
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Note: A leaf is a node with no children.Example:Give...
2018-07-05 20:16:42 484
原创 leetcode111-python 二叉树的最小深度
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.Note: A leaf is a node with no children.Ex...
2018-07-05 19:30:24 619
原创 leetcode110-python 平衡二叉树
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the depth of the two subtrees of every node never differ by...
2018-07-05 16:46:55 1401
原创 leetcode-108 将有序数组转化为二叉搜索树
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the t...
2018-07-05 15:42:13 205
原创 leetcode107-python 二叉树层次遍历
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For example:Given binary tree [3,9,20,null,null,15,7], ...
2018-07-04 20:53:33 563
原创 leetcode104-python 二叉树最大深度
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.Note: A leaf is a node with no children.Ex...
2018-07-04 19:19:45 981
原创 leetcode101-python 对称二叉树
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the...
2018-07-04 14:15:52 946
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人