Dynamic programming ---------- matrix multiplication

Dynamic programming to realize matrix multiplication problem 1, Dynamic programming Dynamic programming is very similar to divide and conquer. The basic idea of dynamic programming is to decompose the problem to be solved into the solutions of several subproblems to obtain the solution of the original problem. Dynamic programming algorithms a ...

Posted by ycoleman on Sun, 28 Nov 2021 23:05:52 +0100

C + + computer experiment 4: object passing and static members

Purpose of the experiment: Further deepen the understanding of classes and objects Master several methods of object transfer Master the concept and use of static members Experiment content part a Understand how three different objects are passed #include<iostream> using namespace std; class Tr { public: Tr(int n) { i = n; } ...

Posted by jtapoling on Sun, 28 Nov 2021 17:46:09 +0100

C/C + + learning record

Pointer and array: (access array elements: through subscript / through pointer) In the array,   The array name is the first address of the array; In combination with the addition and subtraction of the above pointer, access the array 0 Pointer to array: First declare an array and a pointer variable int arr[10]; int *p; Obviously, arra ...

Posted by plastik77 on Sun, 28 Nov 2021 10:46:40 +0100

[LeetCode learning plan] algorithm introduction C + + day 9 breadth first search / depth first search

542.01 matrix LeetCode in etc. \color{#FFB800} {medium} secondary Given a matrix mat composed of 0 and 1, please output a matrix of the same size, where each lattice is the distance ...

Posted by webzyne on Sun, 28 Nov 2021 06:11:07 +0100

Transfer and perfect forwarding

[transferred from]: Author: Su Bingyu Link: https://subingwen.cn/cpp/move-forward/ Source: Da C who loves programming 1. std::move An R-value reference is added in C++11, and an R-value reference cannot be initialized with an l-value. If you want to initialize an R-value reference with an l-value, you need to use the std::move() function to con ...

Posted by phpian on Sun, 28 Nov 2021 05:42:12 +0100

Introduction and use of STL container

Personal summary if there are errors, please correct them What is a container? If you have learned the c language, it will be very simple. The container is like an array, a structure for storing data. The container also needs to indicate the data type to be stored when applying. You only need to insert or take out data through functions. 1, Ne ...

Posted by Braet on Fri, 26 Nov 2021 18:47:50 +0100

An article takes you to understand the stack

Stack Definition of stack Stack is a linear table with limited operation. It can only enter or output elements from one end. It has the property of * * last in first out (LIFO) * *. The first data is pushed into the bottom of the stack, and the last data is at the top of the stack. When you need to read data, POP up data from the top of the s ...

Posted by ziv on Fri, 26 Nov 2021 05:00:18 +0100

C++ Initial - deque + stack queue simulation implementation (not finished)

Deque (double-ended queue) concept Deque (double-ended queue): is a data structure with two openings in a "continuous" space (independent of the queue). Double openings mean that insertions and deletions can be made at both ends of the head and the tail with an O(1) time complexity. Head insertions are more efficient than vec ...

Posted by transfield on Tue, 23 Nov 2021 18:34:45 +0100

[C/C++ Server Development] Servers with rich functionality and can respond to multiple clients simultaneously

1. Preface Review of previous blogs: C/C++ Server/Background Development Learning Route Summary and Preparation What is a server? Server Classification and Building a Simple Server System [C/C++ Server Development] socket Network Programming Function Interface Details [C/C++ Server Development] Flexible application of socket network pr ...

Posted by gassaz on Tue, 23 Nov 2021 18:33:29 +0100

Multithreaded server programming [2] - Essentials of thread synchronization

Four principles of thread synchronizationMinimum sharing of objects, reducing the need for synchronizationUse advanced concurrency components, such as TaskQueue, producer consumer queue, CountDownLatch, etcWhen you have to use the underlying synchronization primitive, only use non recursive mutexes and conditional variables. Use read-write lock ...

Posted by metuin on Tue, 23 Nov 2021 06:26:00 +0100