c + + problem solving report (continuously updated)

The original intention of writing this article is to sort out and review the questions you have brushed 1. Sum of two numbers 1. Sum of two numbers Given an integer array nums and an integer target value target, please find the two integers with and as the target value target in the array and return their array subscripts. You can assume ...

Added by Visualant on Tue, 28 Dec 2021 03:29:40 +0200

An article takes you to understand the introduction syntax of C + +

An article takes you to understand the introduction syntax of C + + C + + keyword (C++98) There are 63 keywords in C + + and 32 keywords in C language Let's take a look at the keywords of C + + through the table asmdoifreturntrycontinueautodoubleinlineshorttypedefforbooldynamic_castintsignedtypeidpublicbreakelselongsizeoftypenamethrow ...

Added by montana111 on Mon, 27 Dec 2021 20:40:07 +0200

OpenCV expansion and corrosion (callback function)

catalogue 1, Structural element 2, Swell 1. Principle 2. Dilation function 3. Code 4. Effect 3, Corrode 1. Principle 2. Corrosion function (erode) 3. Code 4. Effect 4, Simple operation - callback function and slider 1. Callback function 2. Slider creation 3. Code 4. Effect reference material 1, Structural element The ge ...

Added by MikeDXUNL on Mon, 27 Dec 2021 17:43:53 +0200

Design pattern (C + +)

Design mode (I) 1. Singleton mode definition The singleton pattern is that a class can only be instantiated once, more precisely, a class with only one instantiated object. This class can only have one instance (only create a new object when the pointer is null, otherwise return the original object);It must create the instance itself (the c ...

Added by Crysma on Mon, 27 Dec 2021 12:31:54 +0200

C++ vector and stack introductory exercises (using sorting)

Write a C + + program to read positive real numbers into a vector (in random order) Trailing value - 1. Sorts the numbers in ascending order and displays the sorted numbers. Your program must include the following two functions: void sort(vector<float> & v); void display(vector<float> & v); Solution to Q1: #include <iost ...

Added by saadatshah on Sun, 26 Dec 2021 22:02:07 +0200

avx2 uses vpshufb instruction to classify characters

Recently, I saw simdjson's paper on character matching and classification using vpshufb instruction. I feel that this method is very fruitful. I want to share the following.Let's talk about why this instruction is used in simdjson. It needs to extract six control characters (':', \ ',': ',' ',' {','} ') from the character array, and four meanin ...

Added by raytri on Sun, 26 Dec 2021 20:35:31 +0200

CF762 (div3) A~G (H to be supplemented)

First of all, there was no interesting thinking problem after the fight. Instead, it was mainly simulated code farming problem, which was very annoying (referring to being a code farmer in the middle of the night)...... A. Square String? (violence) Judge parity and compare violence #include <bits/stdc++.h> #define ll long long #defin ...

Added by smti on Sun, 26 Dec 2021 11:09:34 +0200

Summary of operations related to Matlab and C/C + + cell array cell

1 operation of cell array cell in MATLAB Create a 6 * 4 array with reshape function: A = reshape(1:20,5,4)' be careful: During the use of reshape function, it should be noted that the dimension of the created array should correspond to the original quantity, otherwise the following error will be reported: 1.1 mutual conversion ...

Added by slipperyfish on Sun, 26 Dec 2021 09:49:29 +0200

Data structure (8-3) binary sort tree (find, insert, delete)

catalogue 1, Basic theory 1. Features: 2. Structure: 2, Search 3, Insert 4, Delete 1. The deleted node D is a leaf node 2. The deleted node D has only one child 2-1. Delete node 14 (left or right) 2-2. Delete node {10 (right or left) 3. Both left and right children of the deleted node exist Method 1: replace the root node with the l ...

Added by fusionxn1 on Sun, 26 Dec 2021 05:21:42 +0200

Summary of inheritance and polymorphism in C + +

1, The essence and principle of inheritance Summary: External objects can only be accessed by public members, but protected and private members cannot be accessed directlyIn the inheritance structure, the derived class can inherit the private member of the base class, but it cannot be accessed directlyThe difference between protected and ...

Added by hairulazami on Sat, 25 Dec 2021 20:14:41 +0200