摘要: Sort a linked list inO(nlogn) time using constant space complexity.分析:题目要求时间复杂度为O(nlogn),所以不能用quickSort(最坏O(n^2)),可以使用mergeSort.对一个链表进行归并排序,首先注意归并排序的基... 阅读全文
posted @ 2015-10-06 20:33 小金乌会发光-Z&M 阅读(325) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.分析:思路比较简单... 阅读全文
posted @ 2015-10-06 20:20 小金乌会发光-Z&M 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文
posted @ 2015-10-06 16:37 小金乌会发光-Z&M 阅读(290) 评论(0) 推荐(0) 编辑