105. 复制带随机指针的链表 中文English 给出一个链表,每个节点包含一个额外增加的随机指针可以指向链表中的任何节点或空的节点。 返回一个深拷贝的链表。 挑战 可否使用O(1)的空间 hashmap写法,O(n)时间复杂度 """ Definition for singly-linked l ...
分类:
其他好文 时间:
2020-08-10 00:07:54
阅读次数:
70
特点:具有超线性收敛速度,只需要计算梯度,避免计算二阶导数 算法步骤 \(step0:\) 给定初始值$x_0$,容许误差$\epsilon$ \(step1:\) 计算梯度$g_k=\nabla f(x_k)$,if \(norm(g_k)<=\epsilon\), \(break;\) 输出当前 ...
分类:
编程语言 时间:
2020-08-09 20:21:06
阅读次数:
98
vi /etc/hosts 两个节点都执行 #Public IP10.10.10.10 shdb110.10.10.20 shdb2#Virtual IP10.10.10.30 shdb1-vip10.10.10.40 shdb2-vip#Private IP192.168.7.10 shdb1-p ...
分类:
其他好文 时间:
2020-08-09 09:18:50
阅读次数:
74
构造字符串 规定相同前缀数目 https://www.ancode.club/index.php/2020/08/07/acm7/ 1 #include<iostream> 2 #include<string.h> 3 #include<cmath> 4 using namespace std; 5 ...
分类:
其他好文 时间:
2020-08-08 23:44:12
阅读次数:
88
首先从ES的支持的字段说起,ES文档中字段有多种类型 官方文档。 这几个比较常用: text,keyword,integer,float,boolean,object,geo_point(地理坐标),geo_shape(描述地理区域),date. 注:不要以为date只能表示 2015-01-01 ...
分类:
其他好文 时间:
2020-08-07 18:08:11
阅读次数:
84
注意建树范围开大一点。 x 先让其 +1 ,树状数组不能维护0 这个点。 int n; int c[32005]; struct Point { int x, y; Point(int _x = 0, int _y = 0) { x = _x; y = _y; } friend bool opera ...
分类:
编程语言 时间:
2020-08-07 12:36:18
阅读次数:
81
链接:https://leetcode-cn.com/problems/word-break/ 代码 /* * @lc app=leetcode.cn id=139 lang=cpp * * [139] 单词拆分 */ // @lc code=start class Solution { publi ...
分类:
其他好文 时间:
2020-08-03 23:33:50
阅读次数:
84
输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历结果。如果是则返回 true,否则返回 false。假设输入的数组的任意两个数字都互不相同。 参考以下这颗二叉搜索树: 5 / \ 2 6 / \ 1 3 示例 1: 输入: [1,6,3,2,5] 输出: false 示例 2: 输入: [1 ...
分类:
其他好文 时间:
2020-08-03 00:51:43
阅读次数:
106