码迷,mamicode.com
首页 >  
搜索关键字:linked_list    ( 3784个结果
LeetCode 114| Flatten Binary Tree to Linked List(二叉树转化成链表)
题目 解析 通过递归实现;可以用先序遍历,然后串成链表 主要思想就是:先递归对右子树进行链表化并记录,然后将root right指向 左子树进行链表化后的头结点,然后一直向右遍历子树,连接上之前的右子树 理解上面代码过后就容易理解: "LeetCode | Flatten Binary Tree t ...
分类:其他好文   时间:2018-08-14 21:57:44    阅读次数:123
lintcode228 - Middle of Linked List - easy
Find the middle node of a linked list.ExampleGiven 1->2->3, return the node with value 2.Given 1->2, return the node with value 1.ChallengeIf the link ...
分类:其他好文   时间:2018-08-14 14:40:38    阅读次数:218
[LeetCode]copy-list-with-random-pointer
题目: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 co ...
分类:其他好文   时间:2018-08-13 14:05:39    阅读次数:110
Leetcode 160. 相交链表
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu... ...
分类:其他好文   时间:2018-08-12 14:21:17    阅读次数:112
92. Reverse Linked List II
Author:hozhangel Time:2018-08-12 11:45:12 92. Reverse Linked List II similar problem: 206. Reverse Linked List Reverse a linked list from position m t ...
分类:其他好文   时间:2018-08-12 14:00:57    阅读次数:122
【leetcode 简单】第十八题 删除排序链表中的重复元素
给定一个排序链表,删除所有重复的元素,使得每个元素只出现一次。 示例 1: 输入: 1->1->2 输出: 1->2 示例 2: 输入: 1->1->2->3->3 输出: 1->2->3 /** * Definition for singly-linked list. * struct ListN ...
分类:编程语言   时间:2018-08-12 10:30:19    阅读次数:139
206. Reverse Linked List
Author: hozhangel Time: 2018-08-11 20:31:01 206. Reverse Linked List problem description: Reverse a singly linked list. Example: Input: 1->2->3->4->5- ...
分类:其他好文   时间:2018-08-11 22:06:02    阅读次数:179
86. Partition List
86. Partition List Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You s ...
分类:其他好文   时间:2018-08-11 20:51:46    阅读次数:117
82. Remove Duplicates from Sorted List II
82. Remove Duplicates from Sorted List II Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from ...
分类:其他好文   时间:2018-08-11 19:39:27    阅读次数:162
92. Reverse Linked List II
92. Reverse Linked List II https://www.youtube.com/watch?v=esl_A_pzBcg&t=304s class Solution { public ListNode reverseBetween(ListNode head, int m, in... ...
分类:其他好文   时间:2018-08-09 19:33:01    阅读次数:132
3784条   上一页 1 ... 61 62 63 64 65 ... 379 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!