摘要: Question: Sort a linked list in O(n log n) time using constant space complexity. Tips:给一个单链表按照val进行排序。 思路:题目要求时间复杂度为nlog(n) 这是归并排序的时间复杂度,即采用分治的方法进行排序。 阅读全文
posted @ 2018-02-24 12:05 于淼 阅读(107) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai 阅读全文
posted @ 2018-02-24 00:33 于淼 阅读(111) 评论(0) 推荐(0) 编辑