摘要:
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? public class Solution { public boolean h 阅读全文
posted @ 2019-04-09 16:28
MarkLeeBYR
阅读(91)
评论(0)
推荐(0)
摘要:
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. public c 阅读全文
posted @ 2019-04-09 16:27
MarkLeeBYR
阅读(180)
评论(0)
推荐(0)
摘要:
Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3->3, 阅读全文
posted @ 2019-04-09 16:27
MarkLeeBYR
阅读(104)
评论(0)
推荐(0)
摘要:
* Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } 阅读全文
posted @ 2019-04-09 16:23
MarkLeeBYR
阅读(114)
评论(0)
推荐(0)
摘要:
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文
posted @ 2019-04-09 16:22
MarkLeeBYR
阅读(85)
评论(0)
推荐(0)
摘要:
Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on 阅读全文
posted @ 2019-04-09 16:22
MarkLeeBYR
阅读(102)
评论(0)
推荐(0)
摘要:
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 a 阅读全文
posted @ 2019-04-09 16:21
MarkLeeBYR
阅读(88)
评论(0)
推荐(0)
摘要:
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2- 阅读全文
posted @ 2019-04-09 16:20
MarkLeeBYR
阅读(75)
评论(0)
推荐(0)
摘要:
Given a list, rotate the list to the right by k places, where k is non-negative. Example: class Solution { public ListNode rotateRight(ListNode head, 阅读全文
posted @ 2019-04-09 16:20
MarkLeeBYR
阅读(135)
评论(0)
推荐(0)
摘要:
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. //剑指offer删除链表中重复的结点 Fo 阅读全文
posted @ 2019-04-09 16:19
MarkLeeBYR
阅读(88)
评论(0)
推荐(0)
浙公网安备 33010602011771号