2021-12-27 swipe questions and punch in every day
2021-12-27 swipe questions and punch in every day
Force buckle - sort
75. Color classification
Given an array of n elements including red, white and blue, sort them in place so that the elements of the same color are adjacent and arranged in the order of red, white and blue.
In this problem, we use integers 0, 1 and 2 to represent red, whit ...
Posted by Pavlos1316 on Tue, 04 Jan 2022 16:27:19 +0100
Quick sorting algorithm
The core idea of quick sort algorithm is to put the elements smaller than the benchmark to the left of the benchmark and the elements larger than the benchmark to the right of the benchmark. After a round of sorting, divide the data to be sorted into two independent parts. All the data in one part is smaller than all the data in the other part, ...
Posted by integravtec on Tue, 04 Jan 2022 16:16:38 +0100
Deep search (DFS) questions
catalogue
1, Foreword
2, Title Description
① Students who want to practice English can read this question carefully to see if they can understand the question. What do you want us to do!
② The following is the input and output of the sample (read the question carefully! There is an implication)
3, Topic interpretation
4, Train of thoug ...
Posted by jateeq on Tue, 04 Jan 2022 14:00:50 +0100
One article explains the operation of the linked list. After reading it, you can easily write the correct linked list code
preface
Linked list, like array, is a linear data structure. The linked list operation in the algorithm is generally aimed at one-way linked list, because one-way linked list is relatively simple, but it can better the thinking ability of postgraduate entrance examination programmers. Although the one-way linked list is relatively simple, it i ...
Posted by paxman356 on Tue, 04 Jan 2022 12:52:23 +0100
Operations research theory, No. 20 | simplex method of algorithm Introduction
Taking the example of issue 16 as an example, we select Matlab and Excel to explain how to realize the general simplex method, large M method and two-stage method. The topics are as follows:
1, Matlab solution
As one of the most popular scientific computing software, MATLAB is widely used in data analysis, wireless communication, deep lea ...
Posted by eraxian on Tue, 04 Jan 2022 12:19:12 +0100
Solution to the 273rd weekly game of Leetcode
Solution to the 273rd weekly game of Leetcode (C + + version)
Problem A - Number reversed twice
meaning of the title Ask whether a number reversed twice is equal to the original number thinking Only the last 0 matches the number 0 code
class Solution {
public:
bool isSameAfterReversals(int num) {
return (num%10||num==0);
}
}; ...
Posted by ginger76 on Tue, 04 Jan 2022 11:24:11 +0100
Group a analysis of the 6th Blue Bridge Cup (2015)
Group a analysis of the 6th Blue Bridge Cup (2015)
1 - bear monster eats walnutsThere is a bear monster in the forest. He likes walnuts very much, but he has the habit of dividing the walnuts he finds into two equal parts each timeEat one and keep one. If it can't be divided equally, the bear monster will throw away a walnut and divide it agai ...
Posted by roopurt18 on Tue, 04 Jan 2022 11:22:15 +0100
A little curiosity about linux: linux startup process
Always curious, how does the operating system work? We know how normal programming makes the code run, but those are high-level things. Later on, you will feel like a castle in the air, or someone has paved a lot of truth for you, but you know nothing about it.
1. Confusion of operating system
Of course, I don't really know anything. Because ...
Posted by teddirez on Tue, 04 Jan 2022 10:42:47 +0100
leetcode brush questions / daily questions 116 Populates the next right node pointer for each node
116. Populate the next right node pointer for each node
Meaning:
Given a perfect binary tree, all leaf nodes are in the same layer, and each parent node has two child nodes. Binary tree is defined as follows:
struct Node {
int val;
Node *left;
Node *right;
Node *next;
}
Fill in each of its next pointers so that this pointer po ...
Posted by moonie on Tue, 04 Jan 2022 10:31:10 +0100
[Leetcode] 765. Couples Holding Hands (with mathematical proof)
Title address:
https://leetcode.com/problems/couples-holding-hands/
There is a given length
2
n
2n
2n array
A
A
A. Number by
0 ...
Posted by sunnypal on Tue, 04 Jan 2022 09:35:40 +0100