Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on ...
分类:
其他好文 时间:
2019-04-09 16:38:07
阅读次数:
151
题目链接:https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/ 题解: 两个 $p,q$ 指针均指向头,然后 $q$ 先往前走 $n$ 步,然后 $p,q$ 一起走,直到 $q$ 走到底,此时 $p$ 的位置即倒数第 $ ...
分类:
其他好文 时间:
2019-03-19 01:26:18
阅读次数:
146
Given a linked list, remove the n-th node from the end of list and return its head. Example: Note: Given n will always be valid. 方法一:双指针 删除倒数第n个点,我们首先 ...
分类:
其他好文 时间:
2019-03-18 23:41:20
阅读次数:
210
题目 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 ...
分类:
其他好文 时间:
2019-03-15 19:19:47
阅读次数:
123
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def ... ...
分类:
其他好文 时间:
2019-03-13 19:44:01
阅读次数:
145
1、E:nth-child(n):匹配元素类型为E且是父元素的第n个子元素 2、E:first-child:匹配元素类型为E且是父元素的第一个子元素3、E:last-child:匹配元素类型为E且是父元素的最后一个子元素4、E > F E元素下面第一层子集5、E ~ F E元素后面的兄弟元素6、E ...
分类:
Web程序 时间:
2019-03-10 09:55:32
阅读次数:
209
In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem, you are given n, you have to fi ...
分类:
其他好文 时间:
2019-02-28 21:21:21
阅读次数:
179
第一种:鼠标经过时table表格中的颜色根据奇偶行改变不同的颜色 第二种:直接用css发生改变,使用了伪类选择器nth-child ...
分类:
Web程序 时间:
2019-02-28 16:47:29
阅读次数:
298
:nth-child: ele:nth-child(k):选择父元素下第k个子元素,且该子元素为ele,若不是,则选择失败,k从1开始计数 ele:nth-child(-n+5):选中前五个子元素,n从0开始 ele:nth-child(n+5):选中第五个子元素后的所有元素,n从0开始 ele:n ...
分类:
Web程序 时间:
2019-02-26 11:52:06
阅读次数:
163
[TOC] LeetCode 单链表专题 $[2]$ Add Two Numbers 模拟,注意最后判断进位是否为1。 时间复杂度 $O(n)$ $[92]$ Reverse Linked List II 给定链表,翻转第m个结点到第n个结点。 从第m+1个结点开始,在第m 1个结点之后的位置用 头 ...
分类:
其他好文 时间:
2019-02-23 01:32:44
阅读次数:
231