摘要: Given a linked list, swap every two adjacent nodes and return its head. Example: Note: Your algorithm should use only constant extra space. You may no 阅读全文
posted @ 2019-01-30 15:36 米开朗菠萝 阅读(125) 评论(0) 推荐(0)
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2019-01-30 14:48 米开朗菠萝 阅读(90) 评论(0) 推荐(0)
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nodes, only nodes its 阅读全文
posted @ 2019-01-30 08:40 米开朗菠萝 阅读(96) 评论(0) 推荐(0)