摘要:
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-... 阅读全文
摘要:
Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted arraynums=[1,1,1,2,2,3],Your function should re... 阅读全文
摘要:
There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have to firs... 阅读全文
摘要:
Sort a linked list inO(nlogn) time using constant space complexity.链表排序,要求时间复杂度O(nlgn),我写的归并排序。/** * Definition for singly-linked list. * public class... 阅读全文