码迷,mamicode.com
首页 >  
搜索关键字:linked    ( 5490个结果
leetcode - Remove Duplicates from Sorted List
题目:Remove Duplicates from Sorted ListGiven a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2...
分类:其他好文   时间:2014-07-10 14:29:45    阅读次数:259
[leetcode] Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
分类:其他好文   时间:2014-07-10 00:18:17    阅读次数:278
LeetCode OJ - Remove Nth Node From End of List
题目:Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After rem...
分类:其他好文   时间:2014-07-07 19:01:42    阅读次数:155
Problem Flatten Binary Tree
Problem Description:Given a binary tree, flatten it to a linked list in-place.Solution:对二叉树进行前序遍历(pre-order). 1 public void flatten(TreeNode root) { 2...
分类:其他好文   时间:2014-07-07 18:47:24    阅读次数:306
LeetCode-Sort List(Python)
【问题】 Sort a linked list in O(n log n) time using constant space complexity. 【代码】 # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # ...
分类:编程语言   时间:2014-06-28 08:29:23    阅读次数:222
LeetCode-Insertion Sort List (Python)
【问题】 Sort a linked list using insertion sort. 【代码】 # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Sol...
分类:编程语言   时间:2014-06-28 07:55:49    阅读次数:199
[leetcode] Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
分类:其他好文   时间:2014-06-27 12:29:18    阅读次数:294
[leetcode] Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head.
分类:其他好文   时间:2014-06-27 12:26:10    阅读次数:322
[leetcode] Add Two Numbers
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:其他好文   时间:2014-06-27 12:21:24    阅读次数:215
LeetCode OJ - Add Two Numbers
题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sing...
分类:其他好文   时间:2014-06-27 11:38:12    阅读次数:207
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!