[PTA] Joseph Ring problem
1. Joseph Ring problem
N people numbered 1, 2,..., n sit around a round table in a clockwise direction, each holding a password (positive integer). At the beginning, select a positive integer m as the upper limit value of counting, start counting from 1 clockwise from the first person, stop counting when reporting to m, and the person reportin ...
Added by jon2396 on Fri, 19 Nov 2021 21:09:23 +0200
C processes and threads
Catalogue of series articles
preface
The generation mode of learning process, such as fork(), system(), exec() functions, etcCommunication and synchronization between Linux processes, including pipe, named pipe fifo, semaphore sem, shared memory shm, message queue msg, and signal. Record their learningLearn the thread programming mo ...
Added by dksmarte on Fri, 19 Nov 2021 16:07:35 +0200
[C language] from introduction to earth (Advanced pointer Chapter 1)
preface: This article is the advanced level of pointer. In the previous article, we have a basic understanding of pointer, but we don't have an in-depth understanding of it. Therefore, we enter the advanced pointer and have an in-depth understanding of the relationship between pointer and other knowledge.
If you haven't read the pointer, ...
Added by rjs34 on Fri, 19 Nov 2021 11:26:46 +0200
Classic topics on functions for beginners
catalogue
Write a callable function. Each call can increase the value of num by 1
Determine the prime number between 100 and 200
Judge leap years between 1000 and 2000
Using dichotomy to find ordered arrays
Write a callable function. Each call can increase the value of num by 1
Tip: it is necessary to use address transfer call (point ...
Added by djmc48 on Thu, 18 Nov 2021 11:46:17 +0200
Basic operators and exercises of C language
1, Executive summary
1. Error prone operator;
2, Detailed content
1. Error prone operator:
○ 1 + +, -, pay attention to distinguish between front and rear.
int i = 10;
int j = ++i;//i is 11 and j is 11
i = 10;
int k = i++;//i is 11 and k is 10
○ 2 /, pay attention to the division problem, that is, the result of dividing an integer by a ...
Added by artcalv on Wed, 17 Nov 2021 14:18:13 +0200
First knowledge of C + + functions
6 function
6.1 general
Function: encapsulate a piece of frequently used code to reduce repeated code
A large program is generally divided into several program blocks, and each module realizes specific functions.
6.2 definition of function
The definition of a function generally consists of five steps:
1. Return value type
2. Function ...
Added by JankaZ on Wed, 17 Nov 2021 07:02:02 +0200
C language learning notes
01. First knowledge of C language
For the learning notes of bit C language, please go to bit homepage: https://m.cctalk.com/inst/s9yewhfr , or B station search bit pengge, a very good teacher in C language! This note is mainly from brother Peng's handouts and pictures!!, If you think it's good, go to pengge's station B video for praise, coin, ...
Added by mordeith on Wed, 17 Nov 2021 06:14:33 +0200
November 12 concurrent 7_ Thread pool (structure + template)
1. Thread pool As we all know, a thread is an executing branch of a process On the operating system, scheduling is carried out on a site by site basis => Theoretically, the more threads a process has, the higher its processing efficiency But in fact, it is affected by the operating s ...
Added by r_honey on Wed, 17 Nov 2021 03:36:16 +0200
Introduction to algorithm 11 -- minimum spanning tree grid length problem
1, Purpose 1. Be familiar with the basic idea of algorithm design 2. Master the idea of minimum spanning tree algorithm 2, Content and design idea
The State Grid Corporation of China wants to lay out an EHV transmission network across the country and connect all provincial capitals. In order to reduce costs and meet some hard requirements, the ...
Added by jeffwhite on Sat, 13 Nov 2021 01:10:23 +0200
c language - review of basic knowledge points
Do a collation of the C language. Don't say the most basic. List some knowledge points that are easy to forget and make mistakes.
1, Pointer
1. Definition of pointer
int a = 100;
int b = 200;
int *p_a = &a; //The pointer variable must be defined with *. Note that the address symbol is taken, and the pointer p_a points to a
print ...
Added by jamie85 on Sat, 13 Nov 2021 00:58:27 +0200