摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. public class ListNode { public int val; public ListNode next; public ListNode() { } public ListNode(int x) { th... 阅读全文
posted @ 2012-09-27 22:53 ETCOW 阅读(491) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18]. 1 public static List<Interval> MergeIntervals(List<Interval> intervals) 2 { 3 List<Interval> ret = new List<Interval>(); 4 5 ... 阅读全文
posted @ 2012-09-27 22:40 ETCOW 阅读(387) 评论(0) 推荐(0) 编辑