码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
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 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
reverse a linked-list(C++)
#includeusing namespace std;class Node{public: Node(int value) : value(value), next(NULL) {}public: int value; Node* next;};Node* reverseList...
分类:编程语言   时间:2014-06-27 20:02:00    阅读次数:253
leetcode - Linked List Cycle
题目:Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?个人思路:1、判断一个链表是否有环,标准做法...
分类:其他好文   时间:2014-06-27 19:41:40    阅读次数:165
[leetcode] Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
分类:其他好文   时间:2014-06-27 12:48:46    阅读次数:259
[leetcode] Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.
分类:其他好文   时间:2014-06-27 12:42:55    阅读次数:198
[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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!