- 博客(3)
- 收藏
- 关注
原创 Insert SortList
public ListNode insertionSortList(ListNode head) { if(head==null||head.next==null) { return head; } ListNode dummy = new ListNode(-1); dumm
2017-02-17 20:40:41 204
原创 reorder list
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example, Given {1,2,3,4}, reorder it t
2017-02-17 00:06:21 157
原创 中间节点确定方法
浅析Sort List和判断回文List中链表中间节点的确定方法1.在使用merge方法对链表排序,以及判断List是否是回文的时候,我们都需要确定中间节点,并从中间节点将链表断开 然后对于sortList ,将前后链表进行merge 对于回文list,将后一段链表翻转,并和前一段链表进行逐个比较具体代码如下 Palindrome Linked List /**
2017-02-16 23:22:12 966
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人