map/set of data structure and algorithm
map/set of data structure and algorithm
map and set are a kind of STL Association container. Generally, when used to quickly find out whether an element exists or repeats, they can be solved through the so-called hash set and hash mapping. In addition to being familiar with their underlying principles, they should also be able to use each cont ...
Posted by ucffool on Mon, 31 Jan 2022 07:41:58 +0100
Implementing two sorting BFS/DFS algorithms with Python class
**
Implementing two sorting BFS/DFS algorithms with Python class
What are BFS and DFS algorithms Code implementation of BFS and DFS algorithms BFS and DFS algorithm (Lecture 3) -- from BFS to Dijkstra algorithm
Idea: When you do this problem, you should first create a lot of nodes, and then build the connection relationship between nodes, an ...
Posted by abie10 on Mon, 31 Jan 2022 07:28:13 +0100
[unofficial solution] 2022 Niuke winter vacation algorithm basic training camp 2
2022 Niuke winter vacation algorithm basic training camp 2_ACM/NOI/CSP/CCPC/ICPC algorithm programming high difficulty practice competition_ Ox guest competition OJ
catalogue
A - furnace stone of Xiaosha
B - little sand's magic
C-xiaosha's kill
D-coloring of small sand
E-xiaosha's long road
F-calculation of small sand
G-xiaosha's body m ...
Posted by TFD3 on Mon, 31 Jan 2022 06:42:34 +0100
Novice entry programming needs to master several violent algorithms c/c + + and convenient data structures
I will put some main knowledge points that need to be used next to the introduction of the algorithm, and I introduce an algorithm by solving a problem rather than directly;
First: find the most value in an array
Challenge arena method:
const int inf=10e9;
int main(){
int n; scanf("%d",&n);
int min=inf,max=-inf;//Set the ma ...
Posted by Waldir on Mon, 31 Jan 2022 05:28:59 +0100
Two ways to realize "Fibonacci sequence" in Java -- array and recursive optimization
This paper uses three ways to realize Fibonacci sequence - array, recursion and optimized recursion.
This paper focuses on the comparison and optimization of the implementation efficiency of Fibonacci sequence.
1, Array implementation of Fibonacci sequence
Test code:
public class ArrayTest {
public static void main(String[] args) {
...
Posted by demophoon88 on Mon, 31 Jan 2022 04:37:21 +0100
[PAT (Basic Level) Practice] - [detailed explanation of common usage of map] 1044 Mars numbers
I. [Topic difficulty]
Class B
II. [Title No.]
1044 Mars number (20 points)
III. [Title Description]
Martians are counted in hexadecimal:Earthman's 0 is called tret by Mars.The Martian characters of earthman numbers 1 to 12 are: jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec.The Martians call the 12 high-order numbers after ...
Posted by sriusa on Mon, 31 Jan 2022 04:10:24 +0100
Tree array and Leaderboard
I. problem elicitation
Internet products should be designed with a ranking list, which is based on scores. The score range is [11000], and each score can have more than one person.
1. Xiao Ming's score is 300. Find out its ranking.
2. After a period of time, the scores of some users have changed, and Xiaoming's scores have also changed. Ask ...
Posted by grevathi_02 on Mon, 31 Jan 2022 03:44:23 +0100
Data structure -- 01
Data structure and algorithm relationship
Data structure data structure is a subject that studies the way of organizing data. With programming language, there will be data structure and write more beautiful and efficient codeTo learn data structure, we should consider more problems in life and solve them with programsProgram = data structure + ...
Posted by bizerk on Mon, 31 Jan 2022 03:10:24 +0100
LeetCode brushes the power of question-3
Preface description
Algorithm learning, daily problem brushing records.
Topic connection
Power of 3
Topic content
Given an integer, write a function to determine whether it is a power of 3. If yes, return true; Otherwise, false is returned.
The integer n is to the power of 3, which needs to be satisfied: there is an integer x so that n == ...
Posted by MoldRat on Mon, 31 Jan 2022 01:49:38 +0100
LeetCode132. Segmented palindrome string II - string dynamic programming
Topic overview
Title Link: Ask me to do the problem
Problem solution
1, General dynamic programming
in that sentence, the dynamic programming of string class can consider the state of the response problem of the first i characters, such as this problem and definition
f
...
Posted by fred_belanger on Sun, 30 Jan 2022 23:46:04 +0100