114. Flatten Binary Tree to Linked List /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode righ... ...
分类:
其他好文 时间:
2018-08-09 18:31:55
阅读次数:
86
426. Convert Binary Search Tree to Sorted Doubly Linked List https://www.youtube.com/watch?v=FsxTX7-yhOw&t=1210s https://docs.google.com/document/d/1I... ...
分类:
其他好文 时间:
2018-08-09 18:29:05
阅读次数:
129
一、链表 概念:链表[Linked List]是由一组不必相连(可连续可不连续)的内存结构(节点),按照特定的顺序链接在一起的抽象数据类型; 分类:链表常用的大概有三类:单链表、双向链表、循环链表(这篇文章主要讲单链表) 操作:链表的核心操作主要有三个(查找遍历、插入、删除) 二、单链表 上图就是一 ...
分类:
其他好文 时间:
2018-08-05 15:53:30
阅读次数:
144
Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: Follow up:Could you do it in O(n) time and O(1) space? Sloving with ...
分类:
其他好文 时间:
2018-08-05 11:51:59
阅读次数:
120
[抄题]: Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". The length o ...
分类:
其他好文 时间:
2018-08-05 10:28:51
阅读次数:
194
1. 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. k is a positive integer ...
分类:
其他好文 时间:
2018-08-03 23:18:45
阅读次数:
248
Question "876.?Middle of the Linked List " Solution 题目大意:求链表的中间节点 思路:构造两个节点,遍历链接,一个每次走一步,另一个每次走两步,一个遍历完链表,另一个恰好在中间 Java实现: ...
分类:
其他好文 时间:
2018-08-02 15:05:17
阅读次数:
122
Given a non empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middl ...
分类:
其他好文 时间:
2018-07-31 22:06:55
阅读次数:
133
问题描述: Remove all elements from a linked list of integers that have value val. Example: 解题思路: 需要注意的是,目标值可能会出现在任意的位置并且出现任意的数量。 用pre来标识目标节点前一个节点,初始化为NULL ...
分类:
其他好文 时间:
2018-07-31 10:56:39
阅读次数:
127
876. Middle of the Linked List first submission 877. Stone Game first submission 用到了双指针哈哈,开森 878. Nth Magical Number 第N个神奇数字 如果正整数可以被 A 或 B 整除,那么它是神奇的 ...
分类:
其他好文 时间:
2018-07-29 14:22:29
阅读次数:
878