Tag:Binary tree

  • Indexing principle and slow query optimization


    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 […]

  • Literacy data structure – Introduction to binary tree


    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 […]

  • Literacy data structure – Introduction to heap


    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 […]

  • Leetcode brush questions – I can flip the binary tree. Does Google want me?


    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 […]

  • Balanced tree


    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 […]

  • [PHP data structure] tree and binary tree


    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. […]

  • [PHP data structure] traversal and logical operation of binary tree


    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 […]

  • [PHP data structure] complete binary tree, clue binary tree and sequential storage structure of tree


    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, […]

  • Why is MySQL index so fast? Understand the magic of indexing


    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 […]

  • C language — creation and traversal of binary tree


    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); […]

  • PAT 1086 Tree Traversals Again


    1086tree traversals again (25 points) An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node 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(). […]

  • The beginning of the tree structure series: how to learn tree structure?


    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 […]