page = session.get(url="https://www.qidian.com/") page.encoding = page.apparent_encoding page_text =page.text tree = etree.HTML(page_text) ...
分类:
编程语言 时间:
2020-02-21 20:32:49
阅读次数:
78
一、技术总结 1. 这是一个平衡二叉树AVL树,就是一个二叉查找树,但是平衡因子不能够超过1。 2. 这个树的数据结构比一般的要多一个height的参数,用于计算平衡因子,就是用当前结点的左子树的height减去右子树的height。 3. 对于node newNode(int data)函数,首先 ...
分类:
其他好文 时间:
2020-02-21 19:56:03
阅读次数:
49
这是一道想起来简单,但是实现起来困难的题目,因为要考虑的情况有点多 https://www.lintcode.com/problem/remove node in binary search tree/ 1.删除节点是叶节点,直接删除 2.删除节点是非叶节点,且非满节点,可用其子树节点取代 3.删除 ...
分类:
其他好文 时间:
2020-02-21 18:00:06
阅读次数:
76
给出一个堆贪心解法 记点$u$的深度为$d_u(d_1=0)$,父亲为$f_u$,拥有儿子数量$es_u$。 首先找到每个点的最远延伸点(点$u$的最远延伸点记为$v_u$),借助树上倍增即可。 接下来是贪心方法 在每次链连接完后删掉这些点,那么每条链的尾端一定是一个叶子。 那么就想办法找出目前贪心 ...
分类:
其他好文 时间:
2020-02-21 14:47:57
阅读次数:
61
Given a binary tree, count the number of nodes in each node’s left subtree, and store it in the numNodesLeft field. Examples 1(6) / \ 2(3) 3(0) / \ 4( ...
分类:
其他好文 时间:
2020-02-21 13:01:03
阅读次数:
75
我不知道大家是不是和我一样是用pip install tensorflow安装的tensorflow库,但是使用的时候,却会显示: Your CPU supports instructions that this TensorFlow binary was not compiled to use: ...
分类:
其他好文 时间:
2020-02-21 12:34:46
阅读次数:
78
上传: #!/bin/sh set -x set -e local_rootPath=/hadoop/datadir/windeploy/temp host="192.168.12.2" # 需要上传的ftp地址 port="21" # 端口 user="ftpuser" # ftp登陆的用户名 p ...
分类:
Web程序 时间:
2020-02-21 09:29:39
阅读次数:
95
在数字电路中,经常会遇到进制转换问题,如二进制 (Binary) 转 BCD (Binary Coded Decimal)。针对这种数制的转换,有个很神奇的算法—— double dabble algorithm ,也称为 shift and add 3 algorithm 。 其主要流程如下(摘自 ...
分类:
其他好文 时间:
2020-02-21 00:07:05
阅读次数:
84
Webpack Quick Start 1.webpack到底是什么? 前端资源加载/打包工具 js→js→png→less→sass 静态分析模块的依赖关系 组织合并打包生成对应的静态资源 2.webpack4新特性 2.1 mode属性 development 浏览器调试工具 注释、开发阶段的详 ...
分类:
Web程序 时间:
2020-02-20 23:51:46
阅读次数:
102
题目描述 输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。 题解:递归 1 public static Tree ...
分类:
其他好文 时间:
2020-02-20 23:38:23
阅读次数:
85