码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
141. Linked List Cycle
Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the posi ...
分类:其他好文   时间:2019-03-16 12:32:44    阅读次数:167
Remove Nth Node From End of List
题目 Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After ...
分类:其他好文   时间:2019-03-15 19:19:47    阅读次数:123
leetcode 19-> Remove Nth Node From End of List
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def ... ...
分类:其他好文   时间:2019-03-13 19:44:01    阅读次数:145
2. 两数相加
* Python3```python# Definition for singly-linked list.# class ListNode:# def __init__(self, x):# self.val = x# self.next = Noneclass Solution: def add... ...
分类:其他好文   时间:2019-03-13 00:09:49    阅读次数:201
203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val. Example: 如果第一个数字,就需要删除,那么需要重置head。所以自己构建1个myHead。 Remove all elements from a l ...
分类:其他好文   时间:2019-03-10 13:35:08    阅读次数:163
[LeetCode] 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Example 2: ...
分类:其他好文   时间:2019-03-02 13:43:04    阅读次数:200
LeetCode 206. Reverse Linked List(C++)
题目: Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 分析: 分 ...
分类:编程语言   时间:2019-03-02 00:52:02    阅读次数:223
C++STL容器forward list
forward list简介 forward list内部以singly linked来管理元素,也可以称为单向链表,它是一个行为受限的list,不能走回头路。创建的宗旨在于“我们希望forward_list和你自己手写的C-style singly linked list 相较之下没有任何空间或时 ...
分类:编程语言   时间:2019-03-01 21:11:54    阅读次数:233
C和C指针小记(十七)-使用结构和指针
1、链表 链表(linked list)即使是一些包含数据的独立数据结构的(Node)集合. 链表中的每个节点通过链或指针链接在一起. 程序通过指针访问链表中的节点. 节点通常是动态分配的,但也有由节点数组构建的链表(即使这样,程序也是通过指针来遍历链表). 1.1 单链表 单链表中,每个节点包含一 ...
分类:其他好文   时间:2019-02-28 18:38:23    阅读次数:118
234. Palindrome Linked List【Easy】【判断链表是否回文】
Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: Follow up:Could you do it in O(n) time and O(1) space? ...
分类:其他好文   时间:2019-02-27 13:22:41    阅读次数:182
3784条   上一页 1 ... 43 44 45 46 47 ... 379 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!