摘要:
题目:Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.题解... 阅读全文
摘要:
题目:Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space?碉堡!reference:http://www.cnblogs... 阅读全文
摘要:
题目:Sort a linked list inO(nlogn) time using constant space complexity.思路:考虑到要求用O(nlogn)的时间复杂度和constant space complexity来sort list,自然而然想到了merge sort方法。... 阅读全文