首先介绍一个数据库常用编码格式区别: 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
Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th ...
分类:
其他好文 时间:
2020-03-05 20:59:24
阅读次数:
115
Given a binary tree, find the subtree with maximum average. Return the root of the subtree. Example 1 Input: {1,-5,11,1,2,4,-2} Output:11 Explanation: ...
分类:
其他好文 时间:
2020-03-05 13:42:34
阅读次数:
56
1 """ 2 Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n? 3 Example: 4 Input: 3 5 Output: 5 6 Explanation: ...
分类:
其他好文 时间:
2020-03-04 23:30:47
阅读次数:
60
索引在生活中最常见的概念,无论是字典,还是图书馆藏书查找,根据索引能节约我们的时间。索引是一种为了高效获取数据的数据结构。要了解数据库索引的底层原理,我们就得先了解一种叫树的数据结构,而树中很经典的一种数据结构就是二叉树。 一、二叉树(Binary Search Trees) 二叉树是每个结点最多有 ...
分类:
数据库 时间:
2020-03-04 23:03:24
阅读次数:
108