//循环修改tree Key 值 mapTree(org) { const haveChildren = Array.isArray(org.childCategories) && org.childCategories.length > 0; return { //分别将我们查询出来的值做出改变他 ...
分类:
其他好文 时间:
2020-04-26 15:30:07
阅读次数:
129
1 //poj1195 二维线段树之树套树 2 // 先确定横坐标所在的区间并记录该结点的编号p,然后再确定纵坐标所在的区间并记录该结点的编号cur,则tree[cur][p]为目标区间。 3 #include <cstdio> 4 #include <cstdlib> 5 #include <cs ...
分类:
其他好文 时间:
2020-04-26 14:15:37
阅读次数:
75
337. 打家劫舍 III https://leetcode-cn.com/problems/house-robber-iii/ /** * Definition for a binary tree node. * type TreeNode struct { * Val int * Left *T ...
分类:
其他好文 时间:
2020-04-26 11:12:02
阅读次数:
55
Kefa decided to celebrate his first big salary by going to the restaurant. He lives by an unusual park. The park is a rooted tree consisting of n vert ...
分类:
其他好文 时间:
2020-04-26 10:57:48
阅读次数:
62
分治算法(1):二分查找!昨天刚说不写算法了,但是突然想起来没写过分治算法的博客,所以强迫症的我…… STL函数库第五弹——二分函数lower_bound()、upper_bound()、binary_search() 由于笔者比较懒,所以把分治算法(二分查找篇)和STL第五弹放在一起。。。 Par ...
分类:
编程语言 时间:
2020-04-26 01:42:28
阅读次数:
75
package LeetCode_930 /** * 930. Binary Subarrays With Sum * https://leetcode.com/problems/binary-subarrays-with-sum/description/ * * In an array A of ...
分类:
其他好文 时间:
2020-04-25 20:51:26
阅读次数:
54
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: ...
分类:
其他好文 时间:
2020-04-25 17:10:35
阅读次数:
72
题目地址 "https://leetcode cn.com/problems/symmetric tree/" 1.递归 本题最简单的思路是递归,可以假设两棵一模一样的树在进行镜像对比。他们之间的关系满足 且`node1.right == node2.left` 时间复杂度O(n) n为节点的个数; ...
分类:
其他好文 时间:
2020-04-25 12:31:45
阅读次数:
53
查看执行计划 db.find(query).explain() “cursor”:“BasicCursor” --说明没有索引 “nscannedObjects”:1000 --理论上要扫描的行数 “cursor”: “BasicCursor sn_1” --用到了btree索引 2. 查看索引 d ...
分类:
数据库 时间:
2020-04-25 11:04:04
阅读次数:
69