Sorting algorithm summary
Sorting algorithm summary
I Exchange sort
1. Bubble sorting Principle: compare the adjacent elements. If the former is larger than the latter, exchange them. Do the same work for each pair of adjacent elements from front to back. In this way, after a bubble, the last element is the largest number. In this way, each bubble determines the pos ...
Posted by DragonFire-N[R] on Sun, 30 Jan 2022 11:18:12 +0100
The most classic language makes the most classic game ゚ヽ(。◕‿◕。)ノ゚.:。+ ゚
Gobang 2.0 coming: ゚ヽ(。◕‿◕。)ノ゚.:
Function overview:
It can realize man-machine combatEveryone can fightYou can surrender and count the game time
Compared with the previous Gobang, the core algorithm has not changed. It still judges whether there are five sub lines in the current state (in four directions) of each chess piece. If there are f ...
Posted by papacostas on Sun, 30 Jan 2022 09:54:46 +0100
Preliminary study on estimating pitch frequency (cepstrum method, autocorrelation method, short-term amplitude difference method)
Pitch frequency detection
1, Concept
What is the pitch period? When people pronounce, according to whether the vocal cord vibrates, the speech signal can be divided into voiced and voiced. Voiced speech carries a lot of energy, so it is also called voiced speech, which has obvious periodicity in time domain. Unvoiced sound is similar to white ...
Posted by mithras on Sun, 30 Jan 2022 09:18:57 +0100
6 questions to solve the monotonous stack problem
Next larger element 1
Title Link Maintain a monotonically decreasing stack, that is, when the traversal element is larger than the top element of the stack, save the result and pop up the top element of the stack In order to get the results in the order of subset array 1, we need to use hash table to establish mapping relationship when ...
Posted by Desai on Sun, 30 Jan 2022 08:33:26 +0100
Double pointer algorithm - Introduction to the algorithm
Double pointer algorithm - Introduction to the algorithm
Overview of double pointer algorithm
The double pointer algorithm should be a special traversal algorithm, which not only uses a single pointer to traverse, but uses double pointers. Note that the pointer here does not refer to pointers such as int *ptr. The double pointer algorithm can ...
Posted by clearstatcache on Sun, 30 Jan 2022 08:29:01 +0100
knn(k-nearest neighbor algorithm) -- python
catalogue
1. Basic definitions
2. Algorithm principle
2.1 advantages and disadvantages of the algorithm
2.2 algorithm parameters
2.3 variants
3. Distance formula in the algorithm
4. Case realization
4.1 import related libraries
4.2 reading data
4.3 read variable name
4.4 define X,Y data
4.5 separate training set and test set
4.6 ca ...
Posted by marcusb on Sun, 30 Jan 2022 07:06:35 +0100
Conjugate gradient method of positive definite quadratic function of optimization method and its implementation (based on Python)
The conjugate gradient method is also one of the conjugate direction methods, but it reduces the search amount of the gradient direction. It directly takes the gradient direction passing through the minimum point of one-dimensional search as our search direction, so it has a certain improvement in the calculation speed. If you are confused abou ...
Posted by ajmoore on Sun, 30 Jan 2022 04:46:20 +0100
SVM support vector machine realizes a linear classification
When support vector machine makes decision, the selected decision boundary needs to meet a condition, that is, the distance from the nearest point in the two classifications is the longest. It can also be understood that when we use support vector machine for classification, what we need to do is to maximize the distance between the decision bo ...
Posted by cypher235 on Sun, 30 Jan 2022 04:45:24 +0100
p1164 number of dynamic programming solutions
Title Description
However uim, due to the purchase of some books, only M yuan (M ≤ 10000) remained in his pocket.
Although the restaurant is low-end, there are many kinds of dishes, including NN (N \le 100)(N ≤ 100), and the i sells ai , yuan (ai ≤ 1000). As it is a very low-end restaurant, there is only one dish for each dish.
Sma ...
Posted by R_P on Sun, 30 Jan 2022 02:29:04 +0100
Adjacency matrix representation of graphs (Java)
1, Basic knowledge understanding
(I have some colloquial explanations + Baidu subject explanations. Please consult the literature for professional explanations. I compiled the introduction graph theory of Discrete Mathematics (Fifth Edition) through Qu Wanling, Geng Suyun and Zhang Linang. This book is a rare good book for introductory compute ...
Posted by BLeez on Sun, 30 Jan 2022 00:36:37 +0100