Tag：Right son

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：2021922
1. Background In the development process, it is necessary to maintain a set of data and quickly add, delete, modify and query. If the amount of data is large and needs to be persisted, choose the database. However, if the amount of data is relatively small, does not need persistence, and requires high response time, […]

Time：2021912
Interview question 33. Post order traversal sequence of binary search tree Method 1: divide the left and right subtrees and recursion In the sequence traversed by post order, the root must be the last.Except for the root, the sequence of the left subtree is in the front and the right subtree is in the back. […]

Time：202194
Recommended reading for this series of articles [sequence table of data structure] use diagrams and codes to make you understand the linear table of sequence structure How to master a sharp weapon of C language – pointer? [linked list of data structure] after reading this article, I finally understand the linked list [stack of data […]

Time：202193
0. Preface Above[concept and principle of binary tree]This paper mainly introduces the related concepts and principles of tree. The main content of this paper is the creation of binary tree and the code implementation of traversal, including recursive traversal and stack traversal. 1. Implementation idea of binary tree 1.0. Sequential storage – array implementation The […]

Time：2021831
Binary tree is an important type of tree structure. The data structure abstracted from many practical problems is often in the form of binary tree. Even a general tree can be simply transformed into binary tree, and the storage structure and algorithm of binary tree are relatively simple, so binary tree is particularly important. The […]

Time：2021829
Data structure – after learning the binary tree creation article, we will sort the binary tree in middle order and output an ordered data.The middle order traversal of binary tree is to traverse the left subtree first, then access the current node, and finally traverse the right subtree. For the following binary tree, the middle […]

Time：2021714
What is a binary search tree Binary search tree is also called binary search tree, ordered binary tree or sorted binary tree He has the following properties: If the left subtree of any node is not empty, the values of all nodes in the left subtree are less than the values of its root node; […]

Time：2021712
1. Three data structures in a set1.1 arrayContinuous memory addressIt can be accessed through subscript members, and subscript access has high performanceThere is a large performance consumption in add / delete operation (dynamic capacity expansion is required)1.2 linked list (bidirectional linked list)Flexible space requirements, storage space does not require continuitySubscript access is not supported, and […]

Time：2021628
Breadth traversal of binary tree Binary tree sequence traversal Binary tree depth traversal: preorder, mesorder, postorder Maximum depth of binary tree Binary search Given the path, traverse the tree to find the node with or without the specified path Quick sort The K largest Longest Common Prefix Longest substring without repeating characters There are many […]

Time：2021611
Portal: https://leetcodecn.com/probl…When learning binary trees, there is a property thatIf the preorder sequence and the middle sequence of traversing binary tree are given, then a unique binary tree can be constructedSo for this problem, the general idea can be solved according to this property. Because the condition of the problem is “balanced binary tree”, the […]

Time：2021610
Topic source here to verify binary search tree Detailed definition of binary search tree I’ll copy the title here~ Given a binary tree, judge whether it is an effective binary search tree. Suppose a binary search tree has the following characteristics: The left subtree of a node contains only the number less than the current […]