摘要: Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iterativ 阅读全文
posted @ 2019-02-01 12:56 Schwifty 阅读(336) 评论(0) 推荐(0)
摘要: 第一个方法,brute force,把所有elements收集到arraylist,然后sort,然后存到linked list。 public ListNode mergeKLists(ListNode[] lists) { List<Integer> l = new ArrayList<Inte 阅读全文
posted @ 2019-02-01 05:24 Schwifty 阅读(177) 评论(0) 推荐(0)