摘要:
1. 原始题目 Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Example 2: 2. 题目理解 给定一个链表,旋转链表,将链表每个节点向右移动 阅读全文
posted @ 2019-04-04 22:39
三年一梦
阅读(137)
评论(0)
推荐(0)
摘要:
1. 原始题目 Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes, only nodes itself m 阅读全文
posted @ 2019-04-04 22:05
三年一梦
阅读(130)
评论(0)
推荐(0)
摘要:
1. 原始题目 Given a linked list, remove the n-th node from the end of list and return its head. Example: 2. 题目理解 删除列表中倒数第n个数 注意:空列表,和n大于链表长度的情况 3. 解题 改题和剑 阅读全文
posted @ 2019-04-04 20:50
三年一梦
阅读(173)
评论(0)
推荐(0)
摘要:
1. 原始题目 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their node 阅读全文
posted @ 2019-04-04 17:00
三年一梦
阅读(354)
评论(0)
推荐(0)
摘要:
1. 原始题目 Reverse a singly linked list. Example: 2. 题目理解 反转一个单链表 注意:空链表的处理,单个结点的处理 3. 解法 因为在反向指向结点的时候容易导致链表出现断裂,所以需3个结点保存当前结点,当前结点之前,之后的结点。 4. 验证结果 1 1 阅读全文
posted @ 2019-04-04 15:32
三年一梦
阅读(143)
评论(0)
推荐(0)
摘要:
1. 原始题目 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 阅读全文
posted @ 2019-04-04 14:51
三年一梦
阅读(547)
评论(1)
推荐(0)

浙公网安备 33010602011771号