Learning notes of data structure, algorithm and application - C + + language description - binary tree

1, Tree A tree t is a set of non empty finite elements, one of which is the root, and the other elements form the subtree of t. As shown in the figure: Each element represents a node. The tree root is painted on the top and its subtree is painted on the bottom. There is an edge between the root and the root of the subtree. Similarly, each ...

Added by danleighton on Wed, 24 Nov 2021 02:08:31 +0200

Swagger access OAuth2 authentication

1.pom dependency Reference the Swagger dependency in the project where you want to use Swagger <dependencies> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.9.2</version> </dependency> <dependency&g ...

Added by mrwowza on Mon, 22 Nov 2021 16:44:32 +0200

Heap downward adjustment algorithm, heap upward adjustment algorithm, heap implementation, Topk problem

catalogue 1, Pile 1. Concept of heap 2. Nature of heap 3. Heap classification 2, Downward adjustment algorithm of heap 3, Heap creation   4, Heap up adjustment algorithm 5, Implementation of heap 1. Heap initialization 2. Heap destruction 3. Heap insertion 4. Deletion of heap 5. Get data from the top of the heap 6. Number of ...

Added by joelg on Mon, 22 Nov 2021 08:15:20 +0200

LeetCode brush notes binary tree binary search tree operation

669 pruning binary search tree Given a binary lookup tree and two integers L and R, and l < R, try pruning the binary lookup tree so that the values of all nodes after pruning are within the range of [L, R]. The input is a binary lookup tree and two integers L and R, and the output is a trimmed binary lookup tree. Input: root = [3,0,4, ...

Added by kindoman on Mon, 22 Nov 2021 07:29:33 +0200

leetcode valid parentheses and circular queues

1. Valid brackets This topic comes from leetcode valid parentheses 1.1 Title Description Tips 1.1.1 interface function bool isValid(char * s){ } 1.2 general framework Although the array can also solve the problem, it is not very good. Some problems will appear later. We try to use the stack to solve the problem Directly using ...

Added by N350CA on Mon, 22 Nov 2021 04:28:16 +0200

If only I had studied binary trees like this

1. Tree structure 1.1 concept (understanding) The tree is no longer a one-to-one linear structure such as sequential list, linked list, stack and queue. The tree is a one to many data structure, which consists of n (n > = 0) disjoint finite node groups and hierarchical sets The features are as follows: There is a special node, called ...

Added by smonsivaes on Sun, 21 Nov 2021 20:58:05 +0200

Binary sort tree of data structure (C + + implementation)

Binary tree is a very, very important part of data structure. As the saying goes, if you don't know the Great Wall, you don't know the data structure. What is a binary tree? We have learned about the linked list before, but when we use it, we will find a problem that each node of the linked list can only point to one node in the same direction, ...

Added by mfouts on Sun, 21 Nov 2021 05:43:43 +0200

[20000 words for Suzhou program] analyze the data structure and eight sorting algorithms ☀️ < ❤️ Remember to collect ❤️>

🏳️‍🌈 Let's talk!!!! 🏳️‍🌈 Suzhou program Dabai 🏳️‍🌈 🍇 1. Time complexity of the algorithm 🍇 1.2. Methods for judging the advantages and disadvantages of procedures Consumption of computer resources and execution efficiency Computing algorithm execution time Time complexity (recommended) 🍇 1.3 time complexity ...

Added by mbarmawi on Sat, 20 Nov 2021 05:51:06 +0200

Data structure - depth first search of graph

Depth first search Unlike breadth first search, depth first search (DFS) is similar to the prior traversal of a tree. As the name implies, the search strategy followed by this search algorithm is to search a graph as "deep" as possible.Its basic idea is as follows: first access a starting vertex v in the graph, and then start from V ...

Added by watts on Sat, 20 Nov 2021 00:09:38 +0200

Sorting algorithm: merge sorting

Java sorting algorithm (IX): merge sorting tip The text here is mainly reprinted. The idea is nothing more than the idea of partition and rule //Idea: the idea of divide and conquer is to separate the array into two arrays (the subdivision of the two arrays is the idea of recursion) //After the two arrays are sorted, they are merged. In the p ...

Added by LanHorizon on Fri, 19 Nov 2021 23:15:51 +0200