摘要: https://oj.leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Solution: 1. O(nk2) runtime, O(1) space – Bru... 阅读全文
posted @ 2015-03-04 21:51 Acjx 阅读(926) 评论(0) 推荐(0) 编辑
摘要: https://oj.leetcode.com/problems/swap-nodes-in-pairs/ Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3.... 阅读全文
posted @ 2015-03-04 18:02 Acjx 阅读(385) 评论(0) 推荐(0) 编辑