[data structure and algorithm] in-depth analysis of the solution idea and algorithm example of "next arrangement"
1, Title Requirements
An arrangement of an integer array is to arrange all its members in sequence or linear order.For example, arr = [1,2,3], the following can be regarded as the arrangement of arr: [1,2,3], [1,3,2], [3,1,2], [2,3,1].The next permutation of an array of integers refers to the next lexicographically ordered permutation of its i ...
Posted by vboyz on Thu, 27 Jan 2022 07:32:00 +0100
B3602 [graph theory and algebraic structure 202] shortest path problem_ 2 problem solving
I was brushing the water question, but I suddenly found this question. It happened to be what we learned yesterday, so we came to consolidate it.
Give it to us
n
n
n points,
m
m
m edge ...
Posted by tomtimms on Thu, 27 Jan 2022 04:30:41 +0100
Topics and partial solutions of the 11th Blue Bridge Cup JavaB group
True question link:
Click here
Completion
Question A: doorplate making (5 points)
Problem Description:
Brief description of ideas:
Solution 1:
The while loop decomposes the number on each bit
code:
public static void main(String[] args) {
int ans=0;
for(int i=1;i<=2020;++i){
int a=i;
while(a!=0){
if(a%10==2)ans ...
Posted by jdimino on Thu, 27 Jan 2022 03:57:14 +0100
Dynamic point divide and conquer
Dynamic point divide and conquer, with repair. Obviously, if the simple use of point divide and conquer will timeout, then we just need to consider inheritance, and there seems to be nothing else. Analyzing the whole process, we need to re count the overall situation if we only change one point. Obviously, it's not good. Then the modified point ...
Posted by 25lez25 on Wed, 26 Jan 2022 21:20:52 +0100
Constructing binary tree from traversal sequence
Constructing binary tree from pre / mid / post traversal sequence
Basics
First of all, we need to know the specific order of the three depth first traversal binary trees:
Preface: middle left and rightMiddle order: left middle rightPost order: left and right middle
In addition, you should know that only middle order + pre / post order can u ...
Posted by hd_webdev on Wed, 26 Jan 2022 20:50:40 +0100
Pointer to various applications [real interview questions of large factories]
Analysis of various applications of pointer and real interview questions of large factories
preface
Most of the pointers learned by beginners or ordinary colleges and universities are simple, that is, we understand that the pointer is an address. We can operate the address content through dereference operation, which is often limited ...
Posted by rharter on Wed, 26 Jan 2022 18:34:39 +0100
Data structure (C + +)_ Tsinghua (Deng Junhui) ~ ~ very detailed~
Data structure (I) school online link. Under data structure (school online). Station B link.
Method steps: 1. Watch the video of station B, type the code and take notes. Online segmentation according to school 2. Compare whether the online video of the school is missing. 3. Do school online exercises and supplement notes.
Chapter - Intro ...
Posted by canobi on Wed, 26 Jan 2022 16:36:07 +0100
Use of monotone stack (with examples, from easy to difficult)
preface
This article uses three examples to explain the single adjustment stack
What is a monotone stack
The elements in the stack are strictly or non strictly monotonically increasing or decreasing When implementing, maintain the order of elements in the stack
Example 1 Acwing1978 (simple)
Title Link https://www.acwing.com/problem/content ...
Posted by Hangston on Wed, 26 Jan 2022 14:52:38 +0100
Hash table and hash bucket simulation implementation, encapsulation unorder_map,unorder_set
Hash concept
Premise: In order structure and balance tree, there is no corresponding relationship between element key and its storage location. Therefore, when looking for an element, it must be compared many times by key. The time complexity of sequential search is O(N), and the height of the tree in the balance tree is O (log n). The ef ...
Posted by bonaparte on Wed, 26 Jan 2022 11:59:31 +0100
Rust basic one-way linked list
Use Rust to complete one-way linked list
I've been idle recently. I saw the rise of rust, a language with a considerable salary. I heard that some linux began to write with rust, but I heard that learning had a curve. At that time, I didn't believe in evil. After learning, I knew that there was a curve... The linked list alone has been done fo ...
Posted by victor78 on Wed, 26 Jan 2022 05:20:59 +0100