码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
Linked List Cycle
Linked List CycleGiven a linked list, determine if it has a cycle in it.c++/** * Definition for singly-linked list. * struct ListNode { * int val;...
分类:其他好文   时间:2014-10-19 23:04:39    阅读次数:206
leetcode第19题--Remove Nth Node From End of List
Problem:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. ...
分类:其他好文   时间:2014-10-19 01:12:55    阅读次数:190
[Leetcode] Linked List Cycle
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Solution:快慢指针。 1 /** 2 * Definition for s....
分类:其他好文   时间:2014-10-17 15:16:48    阅读次数:179
Flatten Binary Tree to Linked List
[leetcode]Given a binary tree, flatten it to a linked list in-place....
分类:其他好文   时间:2014-10-17 12:03:13    阅读次数:119
5 Convert Sorted List to Binary Search Tree_Leetcode
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.这题和sort list等题都比较相似,需要先用快慢指针的方法找到链表的中点,然后...
分类:其他好文   时间:2014-10-16 22:31:43    阅读次数:217
LeetCode——Copy List with Random Pointer(带random引用的单链表深拷贝)
问题: 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 ...
分类:其他好文   时间:2014-10-15 15:40:50    阅读次数:262
Linked List Cycle II
题目描述:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra spac...
分类:其他好文   时间:2014-10-15 11:10:10    阅读次数:219
Linked List Cycle
题目描述:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题方案:使用快慢指针,如果有环,快指针肯定会追上慢指针。下面是该题的代码...
分类:其他好文   时间:2014-10-15 00:03:19    阅读次数:183
【LeetCode】【C++】Linked list cycle 2
面试经常问的一道算法题!...
分类:编程语言   时间:2014-10-14 22:05:49    阅读次数:188
LeetCode——Remove Nth Node From End of List
Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re...
分类:其他好文   时间:2014-10-14 14:52:58    阅读次数:168
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!