摘要:
题目描述:Sort a linked list inO(nlogn) time using constant space complexity.解题方案:题目要求的时间复杂度是O(nlogn),常数级空间复杂度。所以这里用了归并排序,归并排序在数组上操作比较方便,但是这里要排序的是链表。我们用到两个... 阅读全文
摘要:
题目描述:Given an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a linear runtime... 阅读全文