摘要:
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
摘要:
Given a list, rotate the list to the right by k places, where k is non-negative. Example: Tips:右移结点,过程如下: k=2,右移两次: ①5->1->2->3->4 ②4->5->1->2->3 思路:( 阅读全文
摘要:
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. Your 阅读全文