[LeetCode] 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 le... 阅读全文
posted @ 2012-12-27 13:02 小刀初试 阅读(100) 评论(0) 推荐(0)

[LeetCode] Merge Sorted Array 解题思路

摘要: Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space to hold additional elements fr... 阅读全文
posted @ 2012-12-27 12:46 小刀初试 阅读(103) 评论(0) 推荐(0)

[LeetCode] Merge k Sorted Lists 解题报告

摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.» Solve this problem[解题思路]merge sort。外面套一层循环即可。注意指针操... 阅读全文
posted @ 2012-12-27 12:24 小刀初试 阅读(105) 评论(0) 推荐(0)

[LeetCode] Median of Two Sorted Arrays 解题报告

摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ... 阅读全文
posted @ 2012-12-27 11:39 小刀初试 阅读(138) 评论(0) 推荐(0)