用倍增法求后缀数组、名次数组 sa为后缀数组、rank为名次数组 //二分查找法,返回最接近的位置和实际位置 function binary_find(id,hasSortArr){ let l=0,r=hasSortArr.length; let index=-1; while(r-l>0){ c ...
分类:
编程语言 时间:
2020-06-26 16:39:28
阅读次数:
53
注: 本篇文章主要集中在Linux CFS调度器源码解析。文章代码分析基于Linux-4.18.0。 一、进程的创建 进程的创建是通过do_fork()函数完成。新进程的诞生,我们调度核心层会通知调度类,调用特别的接口函数初始化新生儿。我们一路尾随do_fork()函数。do_fork() >_do ...
分类:
其他好文 时间:
2020-06-26 16:37:46
阅读次数:
70
最小生成树 前言 emmm...因为Prim学的不是很好(完全不会编题),所以重点讲Kruskal算法,Prim部分可能会咕很久(炖鸽子警告) 最小生成树 知识搬运 给定一张边带权的无向图 \(G=(V,E),n=|V|,m=|E|\) ,由V中全部n个顶点和E中的 \(n-1\) 条边构成的无向连 ...
分类:
其他好文 时间:
2020-06-26 16:21:41
阅读次数:
68
1、查看当前python pythonquit() whereis python which python 2、进入python官网,下载最新安装包 :https://www.python.org/ wget https://www.python.org/ftp/python/3.8.3/Pytho ...
分类:
编程语言 时间:
2020-06-26 14:36:04
阅读次数:
94
719. 找出第 k 小的距离对 思路: 首先采用了暴力求差值,11组数据超时,优化后利用map来求,结果在最后的两组超时。。然而还是要用二分写,二分差值,最小的为0,最大的是排完序后最后一个数的值减去第一个数的值,取mid,然后在原来数组里继续二分找有多少对差值cnt是小于等于mid的。 若对数c ...
分类:
其他好文 时间:
2020-06-26 14:32:06
阅读次数:
54
xtrabackup 备份 MySQL 8.0.20 时报错: 200626 08:40:59 Connecting to MySQL server host: localhost, user: root, password: set, port: 3306, socket: /data/mysql ...
分类:
其他好文 时间:
2020-06-26 12:40:56
阅读次数:
88
Rectangle Area (M) 题目 Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and ...
分类:
其他好文 时间:
2020-06-26 11:14:20
阅读次数:
61
Given a sorted array A of unique numbers, find the K-th missing number starting from the leftmost number of the array. Example 1: Input: A = [4,7,9,10 ...
分类:
其他好文 时间:
2020-06-26 10:52:26
阅读次数:
72
使用Stream已经快3年了,但是从未真正深入研究过Stream的底层实现。 今天开始把最近学到的Stream原理记录一下。 本篇文章简单描述一下自己对pipeline的理解。 基于下面一段代码: public static void main(String[] args) { List<Strin ...
分类:
其他好文 时间:
2020-06-26 01:36:40
阅读次数:
99
Substring with Concatenation of All Words (H) 题目 You are given a string, s, and a list of words, words, that are all of the same length. Find all star ...
分类:
其他好文 时间:
2020-06-25 21:20:39
阅读次数:
56