2018年3月8日

leetcode链表题

摘要: 1. sort_list Sort a linked list in O(n log n) time using constant space complexity. 分析:时间复杂度是nlogn,所以可以考虑归并排序。取中点,对左边和右边分别递归排序,最后合并。 知识点:快慢指针,用来取链表中点; 阅读全文

posted @ 2018-03-08 21:08 Apiu 阅读(539) 评论(0) 推荐(0) 编辑

导航