[Leetcode question brushing record - greed] (C + +)
greedy
Greedy algorithm or greedy idea adopts greedy strategy to ensure that each operation is locally optimal, so that the final result is globally optimal.
assignment problem
455. Distribution of biscuits
Suppose you are a great parent and want to give your children some cookies. However, each child can only give one biscuit at most.
Fo ...
Added by Zack on Thu, 03 Feb 2022 05:45:44 +0200
C + + classes and objects (medium)
catalogue
Class
Constructor
characteristic
Its characteristics are as follows
Compiler default generated constructor
Piecemeal knowledge
Parameterless constructor call details
The following conflict scenarios may exist for all default and parameterless constructors
reflection
Destructor
characteristic
Com ...
Added by marcela1637 on Thu, 03 Feb 2022 02:34:32 +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
Using MFC to make installation program -- the use of Wizard dialog box
reference resources: Chicken pecks rice When we install the software, a dialog box will pop up to tell us the steps. This is the Wizard dialog box. Today, let's study the method of creating Wizard dialog box. The two basic classes of the Wizard dialog box are property page class CMFCPropertyPage and property sheet class CMFCPropertySheet. Each ...
Added by py343 on Wed, 02 Feb 2022 23:56:31 +0200
The interviewer asked me to tear the code of freshman class? Isn't the offer easy?
This article involves knowledge points: the definition of structure, the use of vector, the use of iterator, the avoidance of wild iterator and the method of sorting. If you need to do a course design such as student management system, this article will be a very important foundation. On this basis, you can easily complete the design of student ...
Added by satan165 on Wed, 02 Feb 2022 23:25:42 +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
C + + -- function object
Many STL algorithms use function objects - also known as function symbols. A function character is any object that can be used in conjunction with () in a functional manner. Including function name, function pointer and class object of overload ().
For example, such a class is the function symbol
class A
{
private:
int a;
public:
A(in ...
Added by marconi8 on Wed, 02 Feb 2022 19:14:37 +0200
Detailed explanation of C++STL: Simulation Implementation of string
Deep and shallow copy of string
Before starting to simulate the implementation of the string class, let's talk about the deep and shallow copy of string
In the previous study of classes and objects, we know that there is no problem using shallow copy (value copy) for Date classes like Date, but for classes like string, shallow copy cannot ...
Added by micbox on Wed, 02 Feb 2022 18:29:41 +0200
Solutions to the three problems of yibentong interceptor missile (noip 1999) + interceptor missile (noip 1999) + interceptor missile
Question 1 [1322: [example 6.4] interceptor missile problem (noip 1999)]
[Title Description]
In order to defend against the missile attack of the enemy country, a certain country has developed a missile interception system, but this interception system has a defect: although its first shell can reach any height, each shell in the future ca ...
Added by kryppienation on Wed, 02 Feb 2022 17:45:00 +0200
Triumph Day9 -- a first acquaintance with C++ STL
catalogue
2. STL acquaintance
2.1 birth of STL
2.2 basic concepts of STL
2.3 STL six components
2.4 containers, algorithms and iterators in STL
2.5 initial knowledge of container algorithm iterator
2.5.2 Vector stores user-defined data types
2.5.3 Vector container nested container
2. STL acquaintance
2.1 birth of STL
For a lon ...
Added by djpic on Wed, 02 Feb 2022 17:34:27 +0200