码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
[leetcode]206.Reverse Linked List
题目 Reverse a singly linked list. Example: Input: 1 2 3 4 5 NULL Output: 5 4 3 2 1 NULL Follow up: A linked list can be reversed either iteratively or ...
分类:其他好文   时间:2018-10-14 11:36:02    阅读次数:115
142. Linked List Cycle II
一、题目 1、审题 2、分析 给出一个链表,如果没有环则返回 null, 若存在环,返回环开始的节点。 二、解答 1、思路: 方法一、 ...
分类:其他好文   时间:2018-10-11 23:49:49    阅读次数:165
141. Linked List Cycle
141. Linked List Cycle (环形链表) 题目概述:判断一个链表中是否有环 思路 创建两个指针(快指针和慢指针),慢指针的移动方式为:单次移动一个结点;快指针的移动方式为:单次移动两个结点。如果快指针指向的结点和慢指针指向的结点相同(注:这里的结点指向了对象,所以直接通过==判断是 ...
分类:其他好文   时间:2018-10-11 22:01:19    阅读次数:163
876. Middle of the Linked List
经典链表题找链表的中间节点 快慢指针 #include #include #include using namespace std; //Definition for singly-linked list. //Given a non-empty, singly linked list with h... ...
分类:其他好文   时间:2018-10-10 01:04:13    阅读次数:139
Leetcode 61
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *///注意取模,和空集 ... ...
分类:其他好文   时间:2018-10-09 16:15:20    阅读次数:135
LeetCode算法题python解法:25. Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to ...
分类:编程语言   时间:2018-10-09 13:57:54    阅读次数:264
25. Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to ...
分类:其他好文   时间:2018-10-07 23:30:32    阅读次数:291
287. Find the Duplicate Number
https://leetcode.com/problems/linked-list-cycle-ii/discuss/44777/Concise-JAVA-solution-based-on-slow-fast-pointers fast slow, 刚开始全部初始化为0,当作起始点 ...
分类:其他好文   时间:2018-10-07 13:55:07    阅读次数:145
142. Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up: Can yo ...
分类:其他好文   时间:2018-10-06 14:36:01    阅读次数:137
24. Swap Nodes in Pairs
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 ...
分类:其他好文   时间:2018-10-05 22:34:58    阅读次数:193
3784条   上一页 1 ... 56 57 58 59 60 ... 379 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!