Divide and conquer thought-merge sort-invert ordinal number

The Idea of Dividing and Treating Score - break down the problem into smaller subproblems; Fix - Fix these smaller subproblems one by one; Combine - Combine the solved sub-problems to get the solution of the "mother" problem. Merge Sort If there is an array A[0...n] Break up the array until there are only two elements left Merging ...

Added by flyankur on Sat, 08 Jan 2022 19:43:07 +0200

[RT thread kernel details series] implementation of priority based full preemptive scheduling algorithm

The unexamined life is not worth living. Life without examination is not worth living. – Socrates 1, Principle overview RT thread is not only an embedded real-time operating system (RTOS), but also an excellent Internet of things operating system. Compared with the bare metal polling scheduling algorithm, its thread (task) scheduling ...

Added by po on Sat, 08 Jan 2022 18:42:17 +0200

Deep analysis of the principle of Bloom filter

In 1970, bloom filter was proposed to judge whether an element is not in a set, but it can not accurately determine whether the element is in the set. Generally, to determine whether an element exists in the set of a business scenario, it is generally to save the element in the set and then determine it through comparison. For example, dat ...

Added by habbardone on Sat, 08 Jan 2022 18:28:02 +0200

Algorithm notes Chapter 9 tree

9.2 traversal of binary tree A1020 This topic examines the algorithm of building a tree from a middle order sequence and another traversal sequence. The key is to write the tree building function. Since we want to build a tree, the return value can be represented by node *. And because of recursive representation, we should pay attention to t ...

Added by rbblue8 on Sat, 08 Jan 2022 12:52:39 +0200

Blue Bridge Cup algorithm training ALGO-1003 - Gift

Problem description Resource constraints Time limit: 1.0s memory limit: 256.0MB Problem description JiaoShou is about to go home after her trip in mainland China. In order to commemorate this trip, he decided to bring back some gifts to his good friends. After walking out of the monster forest, JiaoShou saw N stones in a row. These stones are ...

Added by habbardone on Sat, 08 Jan 2022 12:30:47 +0200

2022LDU winter vacation training - patch

Patch Problem description There are always errors in a program. The company often releases patches to correct these errors. Unfortunately, when correcting some errors with each patch, some errors will be added at the same time. Each patch has a certain running time. A company published a game with n errors B={b1,b2,b3,..., bn}, so the comp ...

Added by MishaPappa on Sat, 08 Jan 2022 12:25:07 +0200

[PAT (Basic Level) Practice] - [find element] 1028

I. [Topic difficulty] Class B II. [Title No.] 1028 census (20 points) III. [Title Description] A census was conducted in a town and the birthdays of all residents were obtained. Now please write a program to find out the oldest and youngest people in the town.Here, ensure that each entered date is legal, but not necessarily reasonable ...

Added by phprocker on Sat, 08 Jan 2022 11:17:34 +0200

Blue Bridge Cup · basic practice (Java)

catalogue 1. Sequence sorting 2. Hexadecimal to octal number 3. Hexadecimal to decimal 4. Decimal to hexadecimal 5. Number of special palindromes 6. Palindromes 7. Special numbers 8. Yang Hui triangle 10. Sequence characteristics 11. Letter graphics 12, 01 string 13. Leap year judgment 14. Fibonacci sequence 15. Area of circle 16 ...

Added by fsumba on Sat, 08 Jan 2022 10:47:53 +0200

Data structure and algorithm: linear table

I Static linked list 1. What is a static linked list a. Static linked list: allocate a whole piece of continuous memory space and place each node centrally. (similar to array) b. The difference between a static linked list and a single linked list is that the static linked list does not store the address pointing to the next node, but the arra ...

Added by MasumX on Sat, 08 Jan 2022 10:40:35 +0200

Gray code / 1046 The weight of the last stone

This problem is a simulation. I know that the solution must use bit operation, but it won't be. It's uncomfortable. Record my stupid thinking than simulation (java takes 41ms, really slow), and then calculate honestly. Idea: 1. First of all, there is an interesting rule for gray codes, that is, the first n gray codes of n+1 bits are positi ...

Added by chelsea7 on Sat, 08 Jan 2022 10:21:34 +0200