Eight sorts of common data structures
catalogue
I. insert sort: 1. Direct insert sort; 2. Hill sort
2. Sorting:
Select sort
Heap sort
Exchange sort person name: bubble sort} the simplest sort, but stable
Implementation of three recursive methods for quick sorting:
Implementation of non recursive method for quick sorting:
Merge sort:
Count sort
I. insert sort: 1. Direct i ...
Added by GreenUser on Tue, 14 Dec 2021 13:14:00 +0200
[SWIG] quick start
Text code address: https://github.com/geodoer/swig-examples/tree/main/A-HelloSWIG Original address: https://www.yuque.com/cpptd/swig/gxz6qc SWIG series notes: https://www.yuque.com/cpptd/swig
After reading this article, you can understand the principle of SWIG and how to use it simply.
A-HelloSWIG
├── simple
| ├── example.h
│ ├── ex ...
Added by sleepydad on Tue, 14 Dec 2021 12:54:07 +0200
Practice learning of circular structure of computer level 2 problems
1. In the following given programs, the function of function fun is to calculate and output the sum of the maximum 10 primes within max. high is passed from the main function to the fun function.
#include <stdio.h>
#include <math.h>
int fun( int high )
{ int sum = 0, n=0, j, yes;
/************found************/
while ((high ...
Added by 4evernomad on Mon, 13 Dec 2021 17:03:01 +0200
07 - Figure 4 Harry Potter's test (25 points)
Harry Potter is going to have an exam. He needs your help. This course is about the ability to change one animal into another with a magic spell. For example, the spell to turn a cat into a mouse is haha, the spell to turn a mouse into a fish is hehe, and so on. A spell that changes in the opposite direction is simply to recite the original spe ...
Added by alohatofu on Mon, 13 Dec 2021 02:35:19 +0200
Summary of basic algorithm template
preface
🌰 Welcome to OpenAll_Zzz's blog, here we work together and make progress together!🎁 The content shared in this issue is a little huge - algorithm. It mainly shares the very stable algorithm template, which mainly helps the author review and use.📝 If you have doubts about an algorithm template, please post your questions in th ...
Added by Danaldinho on Sun, 12 Dec 2021 17:51:10 +0200
[pooling technology] thread pool technology principle and C language implementation
1, Basic concepts
Before talking about thread pool technology, we first explain some basic concepts in the operating system, such as process, thread, thread creation and destruction.
Processes and threads
process An application running in memory. Each process has its own independent memory space. A process can have multiple threads. For ...
Added by driverdave on Sun, 12 Dec 2021 17:13:29 +0200
This article takes you to use a variety of programming paradigms for process encapsulation
preface
Previous examples of adders One article makes it easy for you to master multiple paradigms The packaging differences of various paradigms were explained, and many children's shoes were read. This time, I will continue to explain the differences between these programming paradigms through the encapsulation of processes.
Structural desi ...
Added by Chris_Mc_1985 on Sun, 12 Dec 2021 16:27:23 +0200
The difference between C + + assignment and initialization
There are many operations on variables in C + +, such as assignment, initialization, etc. Many people confuse assignment with initialization. Let's study the difference between assignment and initialization. First of all:
initializationassignmentThis can only be done once in the variable lifecycleIt can be performed an unlimited number of time ...
Added by harshilshah on Sun, 12 Dec 2021 13:25:25 +0200
Report card of headache homework
(who writes the report card in C? [doge])
Experiment content:
There are no more than 30 people in a class (the specific number of people is determined by the actual input) to take the final exam, and no more than 6 (the specific number of courses is determined by the actual input). Student achievement management system is a very practical pro ...
Added by mushroom on Sun, 12 Dec 2021 12:29:40 +0200
Algorithm after class exercises (divide and conquer algorithm)
1. Title:
Let X[0:n-1] and Y[0:n-1] be two arrays, and each array contains n ordered numbers. Try to design an O(logn) time divide and conquer algorithm to find the median of 2n numbers of X and y.
Algorithm idea:
In fact, we don't need to really merge the two arrays. We just need to find out where the median is.
The initial idea is to writ ...
Added by stylefrog on Sun, 12 Dec 2021 12:16:12 +0200