B-tree summary (concept, operation and C language implementation)
recently, I was reviewing the data structure. In order to deepen my understanding of B-tree, I sorted out the following notes, and then implemented B-tree in C language; I haven't used C language for a long time. Some parts of the code don't conform to the specification or there are problems in understanding this article. Please co ...
Posted by EverToDesign on Sat, 25 Sep 2021 06:02:33 +0200
C language fgetc and fputc function usage details
When reading and writing a file as characters, you can read one character from the file or write one character to the file at a time. Two functions are mainly used: fgetc() and fputc().
Character reading function fgetc
Fgetc is the abbreviation of file get char, which means to read a character from the specified file. The usage of fge ...
Posted by bigbstanley on Fri, 24 Sep 2021 16:08:14 +0200
Sorting out the basic syntax of C + +: Ten sorting algorithms
This issue is the 15th section of C + + basic syntax sharing. Today, let's sort out the top five of the top ten sorting algorithms!
Bubble sorting
Bubble sorting idea:
1. Compare adjacent elements. If the first one is bigger than the second, exchange them.
2. Do the same work for each pair of adjacent elements, from the first pair at the ...
Posted by private_guy on Fri, 24 Sep 2021 12:58:18 +0200
2021-9-24 Linux operating system experiment 2: process communication
Experiment 2 of Linux operating system: process communication
Title:
[purpose]
Further improve the ability of C programming in Linux environment, understand and be familiar with a variety of IPC mechanisms supported by Linux. As a multi task and multi process operating system, information interaction between processes is inevitable. Inter pr ...
Posted by hobeau on Fri, 24 Sep 2021 12:17:51 +0200
Several common string operation functions (strlen, strcpy, strcmp, strcat, strstr, strtok, strerror, strncpy, strncmp, strncat)
We all know that C language provides us with many built-in library functions, and these library functions need to refer to their respective header files when they are used.
This article is about several string related functions in < string. H >.
catalogue
1.strlen() - count the number of characters in the string
one point one   ...
Posted by sweyhrich on Fri, 24 Sep 2021 10:28:34 +0200
Data structure - lookup (Part III) - hash lookup
Hash lookup (hash)
In the search of linear tables and tree tables, there is no definite relationship between the position of records in the table and the keywords of records. Therefore, a series of keyword comparison is required when searching records in these tables. This kind of search method is based on "comparison", and the effic ...
Posted by jungalist on Thu, 23 Sep 2021 11:43:14 +0200
Learning notes of c + + Advanced Programming 2
Warning;
In modern C + +, we should avoid low-level memory operations as much as possible and use modern structures, such as containers and smart pointers.
Use dynamic memory
Warning:
As a rule of thumb, each time you declare a pointer variable, be sure to initialize it immediately with the appropriate pointer or nullptr!
For example, Figu ...
Posted by scoobydoo9749 on Wed, 22 Sep 2021 18:45:01 +0200
C + + problems
Qs
What does the Q1 namespace do? What is the difference between Q2 cout output and printf output? Respective advantages and disadvantages? When cin is entered, it ends with a space by default
cout "<<"The operator is overloaded and output according to the data type to be output, printf Is to manually operate the output content format.
...
Posted by djkanebo on Wed, 22 Sep 2021 04:11:14 +0200
Memory allocator - dynamic memory
Dynamic memory management
Why is there dynamic memory allocation
What kind of memory development method have we mastered so far
//Create a variable
int val = 20; //Local variables open up 4 bytes in stack space
int g_val = 10; //The global variable opens up 4 bytes in the static area
//Create an array
char arr[10] = {0}; //The local ...
Posted by notonurnelly on Tue, 21 Sep 2021 21:22:38 +0200
Structure, enumeration, union
structural morphology
1. Problems of the structure
How are points calculated? First, you must master the alignment rules of the structure: \1. The first member is at the address offset from the structure variable by 0. \2. Other member variables shall be aligned to the address of an integer multiple of a number (alignment number). Alignmen ...
Posted by Crashthatch on Tue, 21 Sep 2021 12:03:39 +0200