码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
【leetcode刷题笔记】Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:其他好文   时间:2014-07-23 12:20:16    阅读次数:205
Linked List Cycle leetcode II java (寻找链表环的入口)
题目:Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra spac....
分类:编程语言   时间:2014-07-23 12:02:46    阅读次数:304
Linked List Cycle leetcode java (链表检测环)
题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?题解:这道题连带着II是很经典的,在看CC150时候,纠结这个问题纠结了很久....
分类:编程语言   时间:2014-07-23 12:02:26    阅读次数:311
Remove Duplicates from Sorted List II leetcode java
题目:Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1....
分类:编程语言   时间:2014-07-23 12:01:46    阅读次数:312
Remove Duplicates from Sorted List leetcode java
题目:Given a sorted linked list, delete all duplicates such that each element appear only once.For example,Given 1->1->2, return 1->2.Given 1->1->2->3-....
分类:编程语言   时间:2014-07-23 12:01:16    阅读次数:239
Swap Nodes in Pairs leetcode java
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.http....
分类:编程语言   时间:2014-07-23 12:01:06    阅读次数:330
【leetcode刷题笔记】Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题解:开始想到的方法比较偷懒,直接遍历一遍数组,把每个ListNode对应的值放到...
分类:其他好文   时间:2014-07-22 22:45:13    阅读次数:271
【leetcode刷题笔记】Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked listkat a time and return its modified list.If the number of nodes is not a multiple ofkthen left-o...
分类:其他好文   时间:2014-07-22 22:35:53    阅读次数:230
[leetcode]Sort List
Sort ListSort a linked list inO(nlogn) time using constant space complexity.算法思想:时间复杂度为O(nlogn)的排序算法,有快排、归并、堆排序,快排需要往前遍历,因此不适合单链表,堆排序可以,但是需要O(n)的空间,因此...
分类:其他好文   时间:2014-07-22 00:03:35    阅读次数:187
LeetCode :: Convert Sorted Array (link list) to Binary Search Tree [tree]
1.Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 2.Given a singly linked list where elements are sorted in ascending order, convert it to a heig...
分类:其他好文   时间:2014-07-21 23:45:53    阅读次数:264
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!