You are given two integers nn and dd . You need to construct a rooted binary tree consisting of nn vertices with a root at the vertex 11 and the sum o ...
分类:
其他好文 时间:
2020-03-09 10:32:58
阅读次数:
52
LeetCode 1372. Longest ZigZag Path in a Binary Tree二叉树中的最长交错路径【Medium】【Python】【DFS】 Problem "LeetCode" Given a binary tree , a ZigZag path for a binar ...
分类:
编程语言 时间:
2020-03-08 15:55:09
阅读次数:
79
解决方式:修改my.cnf文件如下 log-bin=mysql-bin server-id=1 ...
分类:
其他好文 时间:
2020-03-08 14:07:29
阅读次数:
78
Given a binary tree, return the preorder traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,2,3] Follow up: Recursive s ...
分类:
其他好文 时间:
2020-03-08 11:13:53
阅读次数:
88
首先介绍一个数据库常用编码格式区别: mysql数据库编码格式utf8_general_ci、utf8_bin、utf8_general_cs区别: utf8_bin将字符串中的每一个字符用二进制数据存储,区分大小写。(bin binary二进制的意思) utf8_genera_ci不区分大小写,c ...
分类:
数据库 时间:
2020-03-06 19:16:18
阅读次数:
81
题目: https://leetcode-cn.com/problems/legal-binary-search-tree-lcci/ 实现一个函数,检查一棵二叉树是否为二叉搜索树。 示例 1:输入: 2 / \ 1 3输出: true示例 2:输入: 5 / \ 1 4 / \ 3 6输出: fa ...
分类:
其他好文 时间:
2020-03-06 17:22:32
阅读次数:
62
老规矩,先上背景,算是表示对LBP算法提出者的一种尊敬(其实,是为了装...kkk,大家都懂ha)。 一、LBP背景: LBP(Local Binary Pattern,局部二值模式)是一种用来描述图像局部纹理特征的算子;它具有旋转不变性和灰度不变性等显著的优点。它是首先由T. Ojala, M.P ...
分类:
其他好文 时间:
2020-03-06 15:38:24
阅读次数:
101
Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally ident ...
分类:
其他好文 时间:
2020-03-06 15:05:00
阅读次数:
54
题目:1367. 二叉树中的列表 链接:https://leetcode-cn.com/problems/linked-list-in-binary-tree/ 题意:略 思路:两种思路太久没有做算法题了。对这类题目不敏感,想当然以为是dp做法,其实就是dfs或者bfs。 dfs做法:从最开始进行思 ...
分类:
其他好文 时间:
2020-03-06 12:47:11
阅读次数:
43
一、题目说明 题目114. Flatten Binary Tree to Linked List,将一个二叉树“原地”压缩为“链表”形态的二叉树。难度为Medium! 二、我的解答 这个题目如果允许使用栈的话Easy,先序遍历二叉树,右子树入栈,左子树入栈。当栈不空的时候,将栈顶元素放到右子树即可。 ...
分类:
其他好文 时间:
2020-03-06 10:51:48
阅读次数:
74