码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
copy-list-with-random-pointer
原文地址:https://www.jianshu.com/p/e8481d454076 时间限制:1秒 空间限制:32768K 题目描述 A linked list is given such that each node contains an additional random pointer ...
分类:其他好文   时间:2019-05-10 14:36:35    阅读次数:124
linked-list-cycle-ii
原文地址:https://www.jianshu.com/p/21009b10c42d 时间限制:1秒 空间限制:32768K 题目描述 Given a linked list, return the node where the cycle begins. If there is no cycle ...
分类:其他好文   时间:2019-05-10 14:33:18    阅读次数:76
21. 合并两个有序链表
题目描述 将两个有序链表合并为一个新的有序链表并返回。新链表是通过拼接给定的两个链表的所有节点组成的。 示例: 分析 类似于归并排序中的合并过程,如果任何一个(l1,l2)为空,直接链接另一条。 贴出代码 java / Definition for singly linked list. publi ...
分类:其他好文   时间:2019-05-10 11:26:49    阅读次数:124
LeetCode3_sort-list(排序、链表)
题目: Sort a linked list in O(n log n) time using constant space complexity. 参考链接: 思路: ...
分类:编程语言   时间:2019-05-07 21:11:46    阅读次数:137
[LeetCode] 138. Copy List with Random Pointer_Medium tag: Linked List
这个题目有两种做法, note: 注意head.random有可能是None的情况 1. S: O(n) create一个dictionary,然后先建dictionary和copy list以及next指针。然后再一遍,去建random指针。 2: S: O(1) 利用如下图所示的结构,然后再将c ...
分类:其他好文   时间:2019-05-04 11:55:30    阅读次数:110
[LeetCode] 86. Partition List_Medium tag: Linked List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the ...
分类:其他好文   时间:2019-05-02 11:38:39    阅读次数:102
[LeetCode] 876. Middle of the Linked List_Easy tag: Linked List
Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middl ...
分类:其他好文   时间:2019-05-02 11:23:58    阅读次数:107
LeetCode || Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy ...
分类:其他好文   时间:2019-05-02 09:37:35    阅读次数:93
【LeetCode每天一题】Remove Duplicates from Sorted List(移除有序链表中的重复数字)
Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Example 2: ...
分类:其他好文   时间:2019-05-01 13:45:03    阅读次数:153
【LeetCode每天一题】 Remove Duplicates from Sorted List II(移除有序链表中重复的节点)
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinctnumbers from the original list. Example 1: Example 2: ...
分类:其他好文   时间:2019-05-01 13:21:13    阅读次数:123
3784条   上一页 1 ... 38 39 40 41 42 ... 379 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!