## 4 billion QQ numbers, limited to 1G memory, how to deduplicate?

4 billion QQ numbers, limited to 1G memory, how to deduplicate? 4 billion unsigned ints, if stored directly in memory, need: 4*4000000000 /1024/1024/1024 = 14.9G, considering that there are some repetitions, the space of 1G is basically not enough. To achieve this function, you can use a bitmap. If you use a bitmap, a number […]

## pyqt5:py handles the conversion of C language format arrays and signed numbers (memo)

Article directory 1. Question: Draw the sine wave represented by the following array with a curve. 1.1 Replace the C language array directly with the py array 1.2 Use numpy to read into the array 1.3 Complete code 2. Generate C array from sine wave data 2.1 Sine wave data 2.2 The formula for converting […]

## Get rid of Random and get random numbers

Recently, when writing some business code, I encountered a scenario where random numbers need to be generated. At this time, I naturally thought of the Random class in the jdk package. But out of the ultimate pursuit of performance, consider using the ThreadLocalRandom class for optimization. In the process of viewing the implementation of ThreadLocalRandom, […]

## An online full-text index BUG troubleshooting: word segmentation and retrieval of Arabic-like numbers

When it comes to word segmentation for full-text search, most of them talk about Chinese (Japanese and Korean) word segmentation, and there are few Latin languages such as English, because English words are naturally word segmentation. But less about Arabic numerals. Such as the amount, mobile phone number, landline number and so on. The following […]

## Teaching-33-02Food Plus Plus Version 2.0 (addition of numbers within 3, 4, 5, 10, 15, 20, random drawing)

Product display Addition of points within 3: the maximum value of addition is 6 Addition of points within 4: the maximum value of addition is 8 Context requirements: When children complete “21 questions for addition within 5 and 21 questions for subtraction within 5”, there are two characteristics: 1. 50% of the children can count […]

## Operator overloading functions as member functions of classes – reduction of rational numbers

Directory 1. Topic Two, the code 3. Algorithm analysis (1) Mathematical expression (2) Code implementation a) + operator overloaded function 2) Optimization function (realize rational number reduction) 1. Title The addition, subtraction, multiplication, and division of two rational number objects is realized by overloading the operator as a member function of the class; A rational […]

## The C++ divide and conquer method realizes the algorithm of multiplying large numbers.

1. Divide and conquer There are two things to understand: (1) The basic idea of the divide and conquer method is to decompose a problem of size n into k smaller sub-problems, these sub-problems are independent of each other and the same as the original problem. (2) Recursively solve these sub-problems, and then combine the […]

## C language to generate random numbers [simple card draw code as an example]

Article directory foreword 1. Generate random numbers rand() function srand() function time() function generate a truly random number 2. Use tips 3. Use code example (simple card draw) Summarize Foreword This article will explain in detail how to generate random numbers in C language, and introduce the application tips 1. Generate random numbers C language […]

## Question 2: Please write the function fun. Its function is to find all integers between 1 and 1000 that are divisible by 7 or 11, but not divisible by 7 and 11 at the same time, and put them in the array pointed to by a , returns the number of these numbers by n.

C test questions Question 2: Please write the function fun. Its function is: find the divisible by 7 or 11 within 1 to 1000, but not divisible by 7 and 11 at the same time All integers and put them in the array pointed to by a, and return the number of these numbers through […]

## Thoughts on Palindromic Numbers in Beijing University of Music (with code)

Tip: After the article is written, the table of contents can be automatically generated. How to generate it can refer to the help document on the right Title If a number (with a non-zero first digit) reads the same from left to right as from right to left, we call it a palindromic number. For […]