What do you call chicken ribs? Multiprocessing, multithreading, and coprocessing in Python

In the process of writing this article, we refer to the content of the course "Introduction to Python Programming and data science" by Mr. Hu Junfeng. Concept: Multiple tasks should be carried out simultaneously at one time, but not necessarily at the same time.Parallel: promote multiple tasks at the same time in a period of time, a ...

Posted by wonderman on Thu, 03 Mar 2022 13:14:01 +0100

2022-03-03 swipe questions and punch in every day

1, The blue bridge cup test questions are divided into candy [the fifth session], [provincial competition], [group B] (1) Problem description Time limit: 1.0s memory limit: 256.0MB There are n children sitting in a circle. The teacher gives each child an even number of sweets at random, and then plays the following game: Each child gave ha ...

Posted by respiant on Thu, 03 Mar 2022 12:29:13 +0100

Heap topK problem heap sorting priority queue object comparison problem

Heap topK problem - heap sorting The concept of heap ❓ To represent a binary tree with the child's representation (a common representation for brushing questions) is essentially a chain storage. In fact, there is also a sequential storage for the storage of binary trees. To put it bluntly, take an array to store a binary tree, and the way to ...

Posted by wendymelon on Thu, 03 Mar 2022 12:01:02 +0100

Comparison of konjaku -- spfa and dijkstra

Because I haven't played the shortest board for a long time, I almost forgot the two algorithms... floyd is too simple, so I remember QAQ No, let's play the board first. You can practice with two questions: Weakened version: [template] single source shortest path (weakened version) - Luogu Enhanced version: [template] single source shortest ...

Posted by bibie on Thu, 03 Mar 2022 07:18:41 +0100

[high frequency interview questions from large factories] explain in detail the implementation of LRU cache (the least used cache recently) - C + + version

1 what is LRU cache LRU (Least Recently Used) algorithm is an elimination strategy. In short, the implementation is as follows: put some elements into a container with fixed capacity for access. Due to the limited capacity of the container, the container should ensure that the elements that have been used recently are always in the contain ...

Posted by lpxxfaintxx on Thu, 03 Mar 2022 04:51:19 +0100

JS: Three Algorithms day1

Backtracking, greedy, and dynamic planning ideas are developed by doing a lot of exercises, not in a few days, and the title won't tell you which algorithm to use. Keep working on the problem. Back-tracking - 46. Full arrangement (medium) 51. Queen N (difficult) Pre-order traversal code executes at the point in time before entering a node, an ...

Posted by jkmcgrath on Wed, 02 Mar 2022 18:34:27 +0100

Hand tearing algorithm -- LRU cache elimination strategy, asked so often

As we all know, the size of cache is limited! When the cache is full, it requires a cache elimination strategy to determine which data should be cleaned out. There are three common strategies: First In, First Out (FIFO), Least Frequently Used (LFU) and Least Recently Used (LRU). Take a look at this LRU design question on LeetCode: 1.Please de ...

Posted by Topper on Wed, 02 Mar 2022 15:59:16 +0100

Detailed explanation of ES6 module and CommonJS and their differences

ES6 module (introduction, features) introduce ES6 introduces modularity. Its design idea is to determine the dependencies of modules and the variables of input and output at compile time. The modularization of ES6 is divided into two modules: export @ and import. characteristic The module of ES6 automatically turns on the strict mode, ...

Posted by dheeraj on Wed, 02 Mar 2022 14:48:58 +0100

KMP algorithm [note]

1 overview of KMP algorithm Recently, when writing leetcode28, I thought of KMP algorithm. I have seen this algorithm roughly before and searched a lot of information on the Internet, but I still can't understand it. Recently, I read it in detail again and finally found something. So make a record to facilitate your memory. Problem Description ...

Posted by coreyk67 on Wed, 02 Mar 2022 14:45:55 +0100

Detailed explanation of common usage of string

catalogue 1. Definition of string 2. Access of contents in string 3. Analysis of common function examples of string In C language, the character array char str [] is generally used to store strings, but sometimes it is troublesome to use string array. String type is added to C + +. Note that if you want to use string, you need to add a ...

Posted by stageguys on Wed, 02 Mar 2022 13:53:52 +0100