Sorting - the most complete knowledge summary of seven sorting algorithms
concept
Sorting: a series of records arranged in ascending or descending order according to the size of one or some keywords. Generally, sorting refers to sorting in place.
What is sort stability
Sorting stability: for two equal data, if the sorting algorithm can ensure that its relative position does not change after sorting, then the a ...
Posted by NikLP on Fri, 11 Feb 2022 16:01:40 +0100
[data structure and algorithm] in-depth analysis of the solution idea and algorithm example of "maximum Rectangle"
1, Title Requirements
Given a two-dimensional binary matrix containing only 0 and 1 and the size of rows x cols, find the largest rectangle containing only 1 and return its area.Example 1:
Input: matrix = [["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]
Output: 6
Example 2:
Input: matrix = []
Outp ...
Posted by solarisuser on Fri, 11 Feb 2022 15:49:53 +0100
Recursive traversal and iterative traversal of binary tree
Binary tree
The so-called traversal refers to one and only one visit to each node in the tree along a search route. The operation of the access node depends on the specific application problem (for example, print the node content and add 1 to the node content). Traversal is one of the most important operations on a binary tree. It is a bin ...
Posted by mikegzarejoyce on Fri, 11 Feb 2022 14:49:31 +0100
Data structure and algorithm - Chapter 3
catalogue
Chapter III
Proposal of linked list
The essence of variable identification in python
Single linked list
Comparison between single linked list and sequential list
Bidirectional linked list
One way circular linked list
Chapter III
Proposal of linked list
Linear list: sequential list + linked list
The sequential list is arran ...
Posted by Braveheartt on Fri, 11 Feb 2022 13:53:51 +0100
UCOS III learning record - time base list
Reference content: Chapter 13 of [wildfire] uCOS-III Kernel Implementation and application development Practical Guide - based on STM32.
1 data type definition and macro definition
1.1 time base list related macro definitions and global variables (os_cfg_app. H / C & OS. H)
In os_cfg_app.h, the macro defines the size of the time base ...
Posted by austar on Fri, 11 Feb 2022 13:05:36 +0100
[Java data structure] - introduction of tree and detailed analysis of binary tree
1, Basic concepts of tree
Definition of tree:
Tree is a nonlinear data structure. It is a set with hierarchical relationship composed of n (n > = 0) finite nodes. It is called a tree because it looks like an upside down tree, that is, it has its roots up and its leaves down. It has the following characteristics:
There is a spec ...
Posted by gaz_hayes on Fri, 11 Feb 2022 09:56:28 +0100
HashMap Implementation Principle and Source Code Interpretation
Preface
When it comes to the implementation principle of HashMap, most of the little buddies think about the structure of "based on arrays and lists or red and black numbers" in their minds, and many people also say that during interviews. This answer is definitely impossible for the interviewer, and I find that the implementation pr ...
Posted by tfburges on Fri, 11 Feb 2022 09:01:49 +0100
[algorithm problem inductive collection] graph theory - difference constraint
The application explanation of differential constraint can jump to: Principle and application of differential constraint algorithm
1, AcWing 1169 candy
[Title Description] In kindergarten
N
N
N children. Now the teacher wants to distribute candy to these children ...
Posted by Ell20 on Fri, 11 Feb 2022 05:47:05 +0100
Algorithm - heap sort
Large top heap: Based on the complete binary tree, the value of each node is greater than or equal to the value of its left and right child nodes
p moves forward through the loop p -- pointer in the main function
public static void main(String[] args) {
int[] arr = {8,7,3,5,4,9,1,3};
for (int p = arr.length-1;p>=0;p--){
...
Posted by witham on Fri, 11 Feb 2022 00:35:33 +0100
Turing Tree (offline query + segment tree / tree array or chairman tree)
Title Link: Turing Tree
General meaning
There is a sequence of length n, numbered from 1 to n, and each position has an element value
Query: multiple queries, the sum of elements after de duplication in each query [l, r]
Problem solving ideas
Offline query + segment tree / tree array or chairman tree
Acacia topic recommendation
Solution ...
Posted by Zippyaus on Fri, 11 Feb 2022 00:17:29 +0100