/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int val) { ...
分类:
其他好文 时间:
2020-07-16 00:01:06
阅读次数:
61
# 二叉搜索树的特点是左子树小于根节点,右子树大于根节点。# 因此当根节点为i的时候,左子树的值为1:i-1,右子树为i+1:n# 当节点为n的时候所有的能够组成的树为左子树个数乘以右子树个数。class Solution: def numTrees(self, n: int) -> int: dp ...
分类:
其他好文 时间:
2020-07-15 23:51:44
阅读次数:
62
题目描述链接:https://leetcode-cn.com/problems/search-in-a-binary-search-tree/ 基本思路:等于返回,当前节点值大于搜索值从左子树搜索,小于从右子树搜索。以此可以用递归或迭代法实现,下面分别展示两种方法; (1)采用递归的方法 LeetC ...
分类:
其他好文 时间:
2020-07-15 23:43:11
阅读次数:
76
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ ...
分类:
其他好文 时间:
2020-07-15 23:40:01
阅读次数:
70
一、软件准备:VM、CentOS-7-x86_64-Minimal-2003.iso 二、用CentOS-7-x86_64-Minimal-2003.iso安装一个虚拟机 三、将ISO所在的/dev/cdrom挂载到/media mount /dev/cdrom /media 四、安装制作发行版的工 ...
分类:
其他好文 时间:
2020-07-15 23:33:00
阅读次数:
125
/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ ...
分类:
其他好文 时间:
2020-07-15 23:31:48
阅读次数:
66
96. 不同的二叉搜索树 自己用dp写的哈哈哈不是很整洁 class Solution { public int numTrees(int n) { int[] res = new int[n + 1]; if(n == 1)return 1; if(n == 2)return 2; res[0] ...
分类:
其他好文 时间:
2020-07-15 23:10:11
阅读次数:
58
代码 https://github.com/smallinsect/MyGo/tree/master/myjson MyUsers.json文件内容 { "name": "小昆虫", "age": 2233, "account_id": "2222222aaaaa", "password": "** ...
分类:
Web程序 时间:
2020-07-15 22:56:01
阅读次数:
155
##题目大意 用栈的形式给出一棵二叉树的建立的顺序,求这棵二叉树的后序遍历 ##tips string用printf输出:printf(“%s”, str.c_str()); ##AC代码 #define _CRT_SECURE_NO_WARNINGS #include<iostream> #inc ...
分类:
其他好文 时间:
2020-07-15 22:48:44
阅读次数:
44
EXPLAIN作为MySQL的性能分析神器,读懂其结果是很有必要的,然而我在各种搜索引擎上竟然找不到特别完整的解读。都是只有重点,没有细节(例如type的取值不全、Extra缺乏完整的介绍等)。 所以,我肝了将近一个星期,整理了一下。这应该是全网最全面、最细致的EXPLAIN解读文章了,下面是全文。 ...
分类:
数据库 时间:
2020-07-14 21:50:05
阅读次数:
75