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