题目:输入一个链表,输出该链表中倒数第k个结点。 这道题可以用快慢指针做,先让first指针走k步,然后first和second指针一起走,直到first指针走到空,这时候second指针就指向倒数第k个结点。 c++代码如下: ...
分类:
其他好文 时间:
2019-12-21 21:01:42
阅读次数:
85
Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: I ...
分类:
其他好文 时间:
2019-12-17 13:19:28
阅读次数:
82
vendors 来源——https://www.docker.com/products/docker-hub Share and Collaborate with Docker Hub Docker Hub is the world’s largest repository of container ...
分类:
其他好文 时间:
2019-12-13 13:58:37
阅读次数:
73
来源——https://www.docker.com/products/docker-hub 回到顶部 Share and Collaborate with Docker Hub Docker Hub is the world’s largest repository of container im ...
分类:
其他好文 时间:
2019-12-13 13:37:00
阅读次数:
141
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note:You may assume k is always valid, 1 ≤ k ≤ BST's ...
分类:
其他好文 时间:
2019-12-07 10:18:19
阅读次数:
76
在未排序的数组中找到第 k 个最大的元素。请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素。 示例 1: 输入: [3,2,1,5,6,4] 和 k = 2输出: 5示例 2: 输入: [3,2,3,1,2,4,5,5,6] 和 k = 4输出: 4说明: 你可以假设 ...
分类:
编程语言 时间:
2019-11-29 11:05:35
阅读次数:
69
ftrace主要是用于调试linux kernel调度相关的一个工具,也可用于分析部分kernel性能问题。 相关ftrace的介绍可以参考:kernel/msm-4.9/Documentation/trace/ftrace.txt 以及同级目录下的其他介绍文件。 谷歌官网的ftrace使用教程(请 ...
分类:
其他好文 时间:
2019-11-22 19:47:18
阅读次数:
84
跳跃表实现简单,空间复杂度和时间复杂度也较好,Redis中使用跳表而不是红黑树。 实现参考了: "跳跃列表 维基百科,自由的百科全书" 《Redis设计与实现》第五章 跳跃表 Redis源码3.0分支src/t_zset.c等文件 插入时的核心逻辑: 1. 找到插入的位置 2. 随机得到新插入节点的 ...
分类:
其他好文 时间:
2019-11-20 16:54:47
阅读次数:
71
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 ...
分类:
其他好文 时间:
2019-11-20 12:37:11
阅读次数:
65
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example ...
分类:
其他好文 时间:
2019-11-18 09:20:14
阅读次数:
59