Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? Given a linked list, determine if it ha ...
分类:
其他好文 时间:
2018-02-20 10:32:42
阅读次数:
124
本文描述了LeetCode 148题 "sort list" 的解法。 题目描述如下: Sort a linked list in O(n log n) time using constant space complexity. 题目要求我们在O(n log n)时间复杂度下完成对单链表的排序,我们 ...
分类:
编程语言 时间:
2018-02-18 17:03:33
阅读次数:
201
分析: 问题是将给定的二叉树变换成令一种形式,这样的类型的问题。其模式是,将左子树变换成某种形式,右子树也变换成这样的形式,然后再与根结点按规定的方式连接起来,那么总体就变换完毕了。这个题我们就能够採用这样的形式。麻烦的地方就是在进行连接的时候。我们如果根为root,左子树变换后的根为root_le ...
分类:
其他好文 时间:
2018-02-17 11:49:26
阅读次数:
193
Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - ...
分类:
其他好文 时间:
2018-02-14 23:39:23
阅读次数:
312
题目描写叙述 链接地址 解法 题目描写叙述 Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. ...
分类:
其他好文 时间:
2018-02-14 18:42:58
阅读次数:
144
这道题很基础也很重要 重点就是设置超前节点 ...
分类:
其他好文 时间:
2018-02-13 12:25:53
阅读次数:
141
非常简单的题:判断链表有没有环(用快慢指针) ...
分类:
其他好文 时间:
2018-02-12 23:38:05
阅读次数:
204
1.题目描述 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. 给出一个链表,返回链 ...
分类:
其他好文 时间:
2018-02-12 22:22:58
阅读次数:
202
1052. Linked List Sorting (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue 时间限制 400 ms 时间限制 400 ms 内存限制 65536 kB 内存限制 65536 kB ...
分类:
其他好文 时间:
2018-02-12 00:20:11
阅读次数:
228
思路很简单 按时链表的题做起来很容易犯小错误,思维要缜密 还要多练习啊 做之前最好画算法框图 ...
分类:
其他好文 时间:
2018-02-11 21:24:00
阅读次数:
231