Tag：Binary tree

Time：20211024
introduce This blog will introduce the following knowledge: Index introduction Indexing principle Data structure of index (binary tree — > balanced binary tree — > b tree — > b + tree) Clustered index and secondary index MySQL index management Syntax for creating and deleting indexes Test after index creation (change in query speed) How […]

Time：20211019
What is a binary tree There is a root nodeExpand two child nodes downThe two child nodes can expand downward. A structure similar to this becomes a binary tree <img style=”zoom:50%;” /> The above is enough to be a binary tree. Of course, if there is a binary tree, there are Trident trees and Quad […]

Time：20211018
What is a heap The pile is a【Complete binary tree】 All of the heap【Root node】”Greater than”【Child node】 The greater than here can be defined. <img style=”zoom:50%;” /> As shown in the figure above, it satisfies the properties above the heap. It is a complete binary tree, and all root nodes are larger than child nodes […]

Time：20211016
Preface description Algorithm learning, daily problem brushing records. Topic connection Flip binary tree Topic content Flip a binary tree. Example: Input: Output: remarks: This question is inspired by Max Howell’s original question: Google: 90% of our engineers use the software you wrote (homebrew), but you can’t write the question of flipping binary tree on the […]

Time：20211016
1、 DefinitionBalanced tree is the combination of search tree and heapA balanced tree is an empty tree or the height difference between its left and right subtrees is no more than 1, and both the left and right subtrees are balanced binary trees.Difference between balanced tree and binary search tree: the balanced tree itself is […]

Time：20211015
The concept of tree is actually very broad and common. Don’t be alarmed when you see this word, because you can see the application of tree structure in our life every day. For example, the organizational structure of the company: In addition, our family tree, or our family structure, is also a typical tree structure. […]

Time：20211014
In the last article, we talked about a lot of theoretical knowledge. Although it is very boring, those are the premise of our study today. When you look at the code later, you will find how important these theoretical knowledge is. First of all, we still want to explain that the main content of our […]

Time：20211013
In the last article, we learned the basic chain structure of binary tree and the operations related to tree building and traversal. Today we are learning some concepts related to binary trees and a variant of binary trees. Complete binary tree What is a complete binary tree? Before we talk about the complete binary tree, […]

Time：20211012
preface The company recently organized a series of technology sharing meetings. I took this opportunity to summarize and record some of my previous knowledge points. Firstly, it is good for the accumulation of their own technology. Secondly, they want to have a deeper understanding of their own knowledge. If there are deficiencies or mistakes, they […]

Time：20211010
Creation and traversal of binary tree: #include<stdio.h> #include<stdlib.h> #define OK 1 #define OVERFLOW 2 typedef int Status; typedef char ElemType; typedef struct BiNode { ElemType data; struct BiNode* lchild, * rchild; }BiTNode, *BiTree; Status Create_ Tree(BiTree *T); // establish Status PreBiTree_ Traverse(BiTree T); // Construction and traversal idea: recursion Status InBiTree_Traverse(BiTree T); Status PostBiTree_Traverse(BiTree T); […]

Time：2021926
1086tree traversals again (25 points) An inorder binary tree traversal can be implemented in a nonrecursive way with a stack. For example, suppose that when a 6node binary tree (with the keys numbered from 1 to 6) is traversed, the stack operations are: push(1); push(2); push(3); pop(); pop(); push(4); pop(); pop(); push(5); push(6); pop(); pop(). […]

Time：2021925
The article begins with the official account of Chen Shu Yi and personal blog.shuyi.tech Tree is a very practical data structure. The most commonly used is the index of database, which is used to find the target value in massive data. For example, if your table has 100 million data. If you use a linked […]