Python array deformation (learning notes)
1.reshape
reshape is reshaping. Three commonly used expressions are as follows:
numpy.arange(n).reshape(a, b)
# n natural numbers are generated in turn and displayed in the form of an array of rows a and columns b
numpy.arange(a,b,c)
# Starting from the number a, the step is c, and ending at b, the array is generated
numpy.ara ...
Added by j0n on Thu, 03 Feb 2022 03:08:42 +0200
cses dynamic programming
Counting Towers
Main idea of the title:
Build a
n
×
2
n \times 2
n × The rectangle of 2 can only be constructed with a rectangle. Ask how many different options there are.
Solution:
The division status is whe ...
Added by mb81 on Thu, 03 Feb 2022 03:00:43 +0200
Data structure -- sorting
1. The concept of sorting
Sorting: the so-called sorting is the operation of arranging a series of records incrementally or decrementally according to the size of one or some keywords. Stability: in the original sequence, r[i]=r[j], and r[i] is before r[j], but in the sorted sequence, r[i] is still before r[j], then this sorting algorithm ...
Added by BlackenedSky on Thu, 03 Feb 2022 02:49:16 +0200
Miaomiao brush force buckle (PTA Special Edition 2)
introduction
I'm trying to write a blog for the first time. I hope you officials will be more tolerant If there are mistakes, I hope you can put them forward. I will correct them in time. Thank you At his best age, he found his future goal There is still one year to struggle and brush questions. Go to interview and practice next year. Come ...
Added by xX_SuperCrazy_Xx on Thu, 03 Feb 2022 01:55:51 +0200
C + + implementation of five common sorting algorithm codes
1. Bubble sorting Average time complexity: O(n^2) Worst time complexity: O(n^2) Space complexity: O(1) Stable: Yes Principle: it repeatedly visits the sequence to be sorted, compares two elements at a time, and exchanges them if they are in the wrong order. The work of visiting the sequence is repeated until there is no need to exchange, that i ...
Added by jalperin on Thu, 03 Feb 2022 01:11:42 +0200
2021 Blue Bridge Cup group B C + + - Travel Notes
2021 Blue Bridge Cup group B national tournament
preface
Because of the power failure in the school, we almost went to the Internet cafe to play the Blue Bridge Cup, but this invigilation method is too outrageous. If we want to cheat, it is easy. Now we are wondering whether we will lose the national award because of this poor invigilation me ...
Added by ell0bo on Thu, 03 Feb 2022 00:17:35 +0200
Freecodecamp JavaScript elementary algorithm question-3
13. Filter false values in the arrayRemove all false values from the arrayFalse values in JavaScript include false, null, 0, "", undefined and NaN.Tip: consider converting each value to a boolean.Input: bouncer([7, "ate", "", false, 9])Output: [7, "ate", 9]Solution 1:function bouncer(arr) {
let temp = [ ...
Added by kc11 on Wed, 02 Feb 2022 23:01:54 +0200
POJ 2251 first blog
It is said that everything is difficult at the beginning, so I want to find a simple topic to write my first solution. My growth starts from now on and will not stop.
Title: you are trapped in a 3D dungeon and need to find the fastest way out! Dungeons consist of unit cubes that may or may not be filled with rock. It takes one minute to move a ...
Added by florida_guy99 on Wed, 02 Feb 2022 22:26:08 +0200
Time series analysis 23 DTW (time series similarity measurement algorithm)
Time series analysis - 23 DTW (time series similarity measurement algorithm)
Preliminary study on DTW
brief introduction
In time series analysis, DTW(Dynamic Time Warping) is an algorithm used to detect the similarity of two time series, which is usually represented by a distance. For example, the following two sequences,
...
Added by mrjcfreak on Wed, 02 Feb 2022 21:02:26 +0200
Algorithm - stack and queue: connected to rain
Algorithm - stack and queue: connected to rain
Give a row of columns with width of 1 and height of n, and calculate the area that can receive rainwater.
Train of thought analysis:
Method 1: using the double pointer method, calculate by column. The first column and the last column do not receive rainwater. Because the width is 1, the area of ...
Added by tserbis on Wed, 02 Feb 2022 20:36:52 +0200