二叉树——144. 二叉树的前序遍历 题目: 思路: 前序遍历用递归,递归逻辑就是前序遍历的顺序:中左右,然后就行了。 代码: class Solution { public: void traversal(TreeNode* node, vector<int>& vec){ // 终止条件 if( ...
分类:
其他好文 时间:
2021-04-12 11:54:04
阅读次数:
0
根据题目意思,实际上我们计算出左右子树的高度相加后即为结果(实际还需-1) 1.深度优先遍历 时间O(n),空间O(h) class Solution { int max= 0; public int diameterOfBinaryTree(TreeNode root) { def(root); ...
分类:
其他好文 时间:
2021-04-12 11:46:11
阅读次数:
0
1045 Access denied for user 'root'@'localhost' (using password:YES) 这个意思是说:用户“root”@本地主机的访问被拒绝 1、首先修改my.ini,在文件中加入skip-grant-tables,重新启动MySQL服务 2、cmd ...
分类:
数据库 时间:
2021-04-12 11:38:52
阅读次数:
0
先查看当前系统时间 root@ubuntu:/# date -R 结果时区是:-0500我需要的是东八区,这儿显示不是,所以需要设置一个时区 1.运行tzselect root@ubuntu:/# tzselect 在这里我们选择亚洲 Asia,确认之后选择中国(China),最后选择北京(Beij ...
分类:
系统相关 时间:
2021-04-10 13:40:28
阅读次数:
0
前言 前几篇中我们使用 用户密码模式 生成的token所使用的用户全部都是模拟的测试用户,通过 AddTestUsers(IdentityServerHost.Quickstart.UI.TestUsers.Users) 方式注入到服务中的,实际项目中用户数据都是从数据库而来,在编译期是不知道都有哪 ...
分类:
其他好文 时间:
2021-04-10 13:30:12
阅读次数:
0
Given a n * n matrix grid of 0's and 1's only. We want to represent the grid with a Quad-Tree. Return the root of the Quad-Tree representing the grid. ...
分类:
其他好文 时间:
2021-04-10 13:22:46
阅读次数:
0
一、创建表 创建模型 创建名为book的app,在book下的models.py中创建模型: from django.db import models # Create your models here. class Book(models.Model): id=models.AutoField(p ...
分类:
数据库 时间:
2021-04-10 13:08:36
阅读次数:
0
sudo是linux系统管理指令,是允许系统管理员让普通用户执行一些或者全部的root命令的一个工具,如halt、reboot、su等等。 登录到root用户 将用户加入sudoers visudo //或者vi /etc/sudoers 移动光标,到一行root ALL=(ALL) ALL的下一行 ...
分类:
其他好文 时间:
2021-04-10 13:05:39
阅读次数:
0
二叉树——236. 二叉树的最近公共祖先 题目: 思路: 后续遍历+DFS:具体思路参照了题解中的解析 代码: class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* ...
分类:
其他好文 时间:
2021-04-09 13:25:04
阅读次数:
0
[root@localhost ~]# uuidgen ens33223bdb47-2fed-4773-b984-5f5733e619042.UUID号写入网络配置文件ifcfg-ens33NAME=ens33DEVICE=ens33ONBOOT=yesUUID=223bdb47-2fed-4773 ...
分类:
系统相关 时间:
2021-04-08 14:02:02
阅读次数:
0