[actual measurement] speed comparison of string search in Python and C + +

Full format link: https://blog.imakiseki.cf/2022/03/07/techdev/python-cpp-string-find-perf-test/ background Recently, in preparation for an algorithm competition, the language mistakenly chose python, so we had no choice but to start language migration for common scenes. The scene of string search appears from time to time in the algorithm co ...

Added by MBDesktop on Mon, 07 Mar 2022 11:44:22 +0200

CSP-202112-3-boarding pass

reference resources Reference problem solution 1 The blogger above actually said it very carefully. Maybe the polynomial is a little obscure, but after understanding it, I found that the blogger did say it in detail. calculation g ( x ) ...

Added by beefy23 on Mon, 07 Mar 2022 04:52:16 +0200

Hello Qt -- mixed programming of QML and C + +

1, Introduction to mixed programming of QML and C + + QML and C + + mixed programming is to use QML to build UI efficiently and conveniently, while C + + is used to realize business logic and complex algorithms. 2, QML access C++ Qt integrates QML engine and Qt meta object system, which makes QML easy to be extended from C + +. Under certain ...

Added by sabbagh on Sun, 06 Mar 2022 18:55:19 +0200

muduo note log Library

muduo log library is an asynchronous high-performance log library. Its performance cost is about 1.0us~1.6us for each log message written by the front end. Log base model double buffering interaction technology is adopted. The basic idea is to prepare two parts of buffer: A and B. the front end thread fills buffer A with data (log messages), ...

Added by MrCool on Sun, 06 Mar 2022 16:54:30 +0200

Application of two-dimensional array: Sanzi chess

Multi file programming: in the process of writing code, it is impossible to put all the code into one file. Here, the code executed by the game, the declared function and the implementation of the function are written separately, which can improve the readability of the code, facilitate the modification of the code, reduce coupling, improve the ...

Added by MLJJ on Sun, 06 Mar 2022 16:09:03 +0200

Application of algorithm training camp graph (topological sorting)

Topological sorting principle An acyclic directed graph is called a directed acyclic graph.Directed acyclic graph is an effective tool to describe the process of engineering, planning, production and system. There are usually certain constraints between activities. For example, sequence.A directed graph that uses nodes to represent activities ...

Added by jay7981 on Sun, 06 Mar 2022 15:27:54 +0200

C + + combat notes

iterator The container member () is generally provided by the function. Begin() / end() / begin() / cen() Call them to get iterators representing two endpoints. Functions with "c" prefix return constant iterators, but the specific type is best derived by automatic type: vector<int> v = {1, 2, 3, 4, 5}; anto iter1 = v.begin(); ...

Added by drepster on Sun, 06 Mar 2022 09:35:51 +0200

Simulate a sequential stack

1. Introduction As a common abstract data type, stack is very common in common use. It is a linear table with limited operation. Limit linear tables to insert and delete only at the end of the table. This end is called the top of the stack, and the other end is called the bottom of the stack. Inserting a new element into a stack is also called ...

Added by wcl99 on Sun, 06 Mar 2022 09:07:30 +0200

[C + +] string common interface

1, STL STL (Standard Template Library): it is an important part of C + + standard library. It is not only a reusable component library, but also a software framework including data structures and algorithms. 2, string 1. Definitions String is a template class of string int main() { string s1("hello");//Construction object ...

Added by galewis on Sun, 06 Mar 2022 08:46:24 +0200

Iterator mode (C + + implementation)

1. Definitions A design pattern that provides a method to access elements in a collection in sequence, but does not expose the implementation details inside the collection, belongs to behavioral design pattern The iterator mode separates the storage and traversal of data. The storage is handed over to the aggregation class, and the travers ...

Added by cedricm on Sun, 06 Mar 2022 06:10:04 +0200