码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
力扣—Remove Duplicates from Sorted List(删除排序链表中的重复元素)python实现
题目描述: 中文: 给定一个排序链表,删除所有重复的元素,使得每个元素只出现一次。 示例 1: 输入: 1->1->2输出: 1->2 示例 2: 输入: 1->1->2->3->3输出: 1->2->3 英文: Given a sorted linked list, delete all dupl ...
分类:编程语言   时间:2019-10-08 21:55:25    阅读次数:86
61. Rotate List
题目描述 Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Example 2: 参考答案 答案分析 分成三部分: 1. 链接首尾 2. 移动 3. 拆 ...
分类:其他好文   时间:2019-10-08 20:32:23    阅读次数:99
LC 206. Reverse Linked List
题目描述 Reverse a singly linked list. Example: 参考答案 补充说明 term 1: temp = 2 3 4 5 null head = 1 null = 1 2 3 4 5 null + null cur = 1 null head = 2 3 4 5 nu ...
分类:其他好文   时间:2019-10-06 13:46:52    阅读次数:96
LC 417. Linked List Cycle II
题目描述 Given a linked list, return the node where the cycle begins. If there is no cycle, return null. To represent a cycle in the given linked list, we ...
分类:其他好文   时间:2019-10-05 20:32:28    阅读次数:122
【PAT甲级】1052 Linked List Sorting (25 分)
题意: 输入一个正整数N(<=100000),和一个链表的头结点地址。接着输入N行,每行包括一个结点的地址,结点存放的值(-1e5~1e5),指向下一个结点的地址。地址由五位包含前导零的正整数组成。以头结点地址开始的这条链表以值排序后得到的链表的长度和头结点,接着以升序按行输出每个结点的地址和值以及 ...
分类:其他好文   时间:2019-10-03 12:16:42    阅读次数:64
链表-LinkList
什么是链表 维基百科:链表(Linked list)是一种常见的基础数据结构,是一种线性表,但是并不会按线性的顺序存储数据,而是在每一个节点里存到下一个节点的指针(Pointer)。由于不必须按顺序存储,链表在插入的时候可以达到O(1)的复杂度,比另一种线性表顺序表快得多,但是查找一个节点或者访问特 ...
分类:其他好文   时间:2019-10-01 00:05:46    阅读次数:119
[LC]141题 Linked List Cycle (环形链表)(链表)
①中文题目 给定一个链表,判断链表中是否有环。 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始)。 如果 pos 是 -1,则在该链表中没有环。 示例 1: 输入:head = [3,2,0,-4], pos = 1输出:true解释:链表中有一个环, ...
分类:其他好文   时间:2019-09-29 20:14:15    阅读次数:98
[LeetCode 1171] Remove Zero Sum Consecutive Nodes from Linked List
Given the head of a linked list, we repeatedly delete consecutive sequences of nodes that sum to 0 until there are no such sequences. After doing so, ...
分类:其他好文   时间:2019-09-29 09:14:16    阅读次数:113
[LC] 203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val. Example: ...
分类:其他好文   时间:2019-09-25 12:23:38    阅读次数:75
[LC]203题 Remove Linked List Elements (移除链表元素)(链表)
①英文题目 Remove all elements from a linked list of integers that have value val. Example: ②中文题目 删除链表中等于给定值 val 的所有节点。 示例: ③思路 1、加入链表为空,那么直接返回head。 2、考虑6, ...
分类:其他好文   时间:2019-09-24 14:27:17    阅读次数:93
3784条   上一页 1 ... 28 29 30 31 32 ... 379 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!