C and pointer learning notes -- string common library functions

This series is mainly some notes on my study of C and pointer. It is mainly about some small details for my own study and reference. In detail, it is suggested that you can read some of C and pointer String length The prototype of the library function strlen is as follows: size_t strlen( char const *string ); Note that strlen retur ...

Posted by maga2307 on Thu, 07 Oct 2021 22:47:46 +0200

❤ C language -- linked list -- data structure ❤

1. Concept of linked list Linked list is a basic data structure. Linked list can dynamically allocate storage. In other words, linked list is a very powerful array. It can define a variety of data types in nodes, and can add, delete and insert nodes as needed. We only allocate memory for one node at a time. The linked list uses pointers to ...

Posted by rajsekar2u on Thu, 07 Oct 2021 20:27:00 +0200

Tree of basic data structure and algorithm - C language implementation

Binary tree The main operation sets provided are: Three recursive TraversalsThree non recursive Traversalslevel traversal Output leaf nodeRecursively find the height of binary treeCreate a binary tree from an arrayDestroy binary treeConstructing expression tree from suffix expression code implementation #include <stdio.h> #include &lt ...

Posted by KrisNz on Thu, 07 Oct 2021 09:56:28 +0200

Linux multi-threaded reader/writer problem: Read-first, write-first, fair queuing implementation

1.Introduction to Tasks A data file or record can be shared by multiple processes. We call processes that only require reading the fileReader stalks, and other processes are called writer processes. Allow multiple processes to read a shared object at the same time, since reading does not confuse the data file. However, a writer process and oth ...

Posted by fantic on Tue, 05 Oct 2021 18:05:06 +0200

⭐ Advanced C language ⭐ ⅸ detailed explanation of document operation [ suggested attention + collection ]

catalogue Why use files What is a file Classification (from the perspective of file function) file name Opening and closing of files field name pointer fopen and fclose functions Open method table Sequential reading and writing of files Sequential read-write function table What is an input / output stream fgetc/fgetc character rea ...

Posted by insight on Tue, 05 Oct 2021 04:49:35 +0200

Flexible array (array size is not fixed) and its pointer implementation method

1. What is a flexible array The definition of an ordinary array must add a "constant" in square brackets after the array name. However, in actual use, the size of the array is often not known in advance. If it is too large, it is easy to waste space, and if it is too small, it is not enough. At this time, we need to introduce the con ...

Posted by ninedoors on Tue, 05 Oct 2021 00:55:35 +0200

KMP algorithm-C language implementation of basic data structures and algorithms

Summary KMP (invented by Knuth,Morris,Pratt) algorithm with time complexity: T = O ( n + m ) ...

Posted by mika79 on Mon, 04 Oct 2021 19:26:44 +0200

Three optimizations of bubble sorting in C language and the analysis and Simulation of qsort function

Bubble sorting When we first mention bubble sorting, we always ask what is bubble sorting? In short, it is to repeatedly visit the element column to be sorted, compare two adjacent elements in turn, and exchange them if the order (e.g. from large to small and from Z to A) is wrong. The work of visiting elements is repeated until no adjac ...

Posted by verdrm on Mon, 04 Oct 2021 05:50:25 +0200

Intensive reading of big talk data structure, accompany you to win 45 points EP5 string application and implementation

strlen function Function of strlen The strlen function calculates the length of a string char* p ="abcdef"; int ret = strlen(p); Action mechanism of strlen When the string is stored, the last bit will be set to 0 by default char* p = "abcdef"; abcdefABCDEF \ 0 is stored in memory When our strlen function works, it starts from ...

Posted by Hayce on Sun, 03 Oct 2021 22:50:31 +0200

week4 KMP+Chain List+Stack+Queue

1. KMP Next array: what is the length of the longest common prefix for each location of the storage pattern string, and then when moving the pattern string pointer, when p[j]!=When s[i] (p mode string, s main string), pointer J can move quickly, that I s, j=next[j]. Why? Title: Activities - AcWing #include<iostream> #include<strin ...

Posted by beermaker74 on Sun, 03 Oct 2021 18:08:29 +0200