![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
犹影随行
这个作者很懒,什么都没留下…
展开
-
LeetCode:Maximum Depth of Binary Tree
转载自 http://www.cnblogs.com/bakari/p/4126693.html要求:求二叉树的深度(二叉树的深度为最远叶子节点到根节点的距离,即根节点到最远叶子节点的距离)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along th转载 2015-02-07 12:47:37 · 262 阅读 · 0 评论 -
Leetcode: Binary Tree Preorder Inooder Traversal
Given a binary tree, return the preorder traversal of its nodes' values./** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; *转载 2015-02-07 20:06:33 · 258 阅读 · 0 评论 -
LeetCode: Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4,−1,2,1] ha转载 2015-02-09 18:57:32 · 255 阅读 · 0 评论 -
LeetCode:Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element转载 2015-02-12 17:04:46 · 422 阅读 · 0 评论 -
LeetCode:Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.主要参考一下博客:http://blog.csdn.net/kenden23/article/details/13274385http://blog.csdn.net/a836转载 2015-02-12 20:37:19 · 300 阅读 · 0 评论