First understanding of the idea of partition and rule (notes of runners)

Shuwen's future goal: enter the big factory~ 🤪. Let my family relax and try to make life better, okay! Shu Wen's current situation: big dish chicken, from food to code, has made many learning friends (great) 👍) Blog purpose: writing a blog is to record your learning path It's also to brighten the interviewer's eyes, and then pretend to ...

Posted by califdon on Sat, 16 Apr 2022 01:35:25 +0300

Dynamic memory management ---- malloc, free, calloc, realloc; Common dynamic memory errors

catalogue 1, malloc 2, free 3, calloc 4, realloc Required header file: include < stdlib h> 1, malloc, free Function: void* malloc (size_t size); Introduction: this function applies for a continuously available space from memory and returns a pointer to this space. If the development is successful, it returns a pointer to the deve ...

Posted by gmcalp on Fri, 15 Apr 2022 18:33:28 +0300

C language - array exercises

Topic 1: diagonal elements and Find the sum of diagonal elements of a 3 * 3 integer matrix. Solution: For us, when we don't know what diagonal is, we can't find the sum of diagonal elements. Therefore, to make the computer calculate, you have to tell the computer which elements are diagonal elements. Here we need to give a feature to ...

Posted by Holoverse on Fri, 15 Apr 2022 10:53:41 +0300

[Leetcode] 2 questions: thoroughly understand stacks and queues

preface 🎬 OK, I specifically learned the knowledge of stack and queue. Then the main content of this blog is to do three OJ questions. After learning, we must brush the questions in time to deepen our understanding and consolidation. Otherwise, it is difficult to make progress, which is conducive to our better learning of stack and queue of ...

Posted by PHP_TRY_HARD on Fri, 15 Apr 2022 03:00:49 +0300

Preprocessing and function types

1, Macro definition 1.1 macro definition without parameters #define PI 3.14159 It is generally expressed in uppercase letters to distinguish it from variable names #define SIDE 5 #define PERIMETER 4 * SIDE #define AREA SIDE * SIDE #define STAND "you are girl" printf(STAND); Note: If there is a macro name in the string, it will n ...

Posted by aouriques on Thu, 14 Apr 2022 23:19:09 +0300

Discuss the timeout problem of the contact algorithm on LeetCode

Some students may not have a concept of the speed of the computer, but feel that the computer should run very fast. Then why do they timeout when doing algorithm problems on LeetCode? How many operations can a computer 1s perform? Next, let's explore this problem. 1. Reasons for timeout Everyone should have encountered an error when pra ...

Posted by kol090 on Wed, 13 Apr 2022 08:51:51 +0300

Branch and loop statements

1. What is a statement? Inside the main() function are instructions and related data arranged in order. We can understand these instructions and data as commands we send to the computer. In programming languages, we call such commands statements. C statements can be divided into the following five categories: Expression statement ...

Posted by love_php on Wed, 13 Apr 2022 05:11:58 +0300

[C] Beginner's little difficulty ~ linked list~

Recently, I began to understand the structure of c language, including the concept of linked list. Preliminary understanding of his implementation. Now let me share with you how to learn the linked list. catalogue [1] Basic concepts of linked list [2] Static linked list 1. We first create a structure as the node data type. 2. Create node ...

Posted by chrispols on Tue, 12 Apr 2022 22:22:55 +0300

STM32F407 realizes key control periodic square wave switching output

catalogue preface 1, Change timer settings 2, Interrupt program summary preface The book continued last time. After completing the key control flow lamp, I had a new understanding of the interrupt system, so the key control square wave output became simple this time. Next, let's look at the specific task: generate square wave with ...

Posted by Youko on Tue, 12 Apr 2022 21:55:19 +0300

Advanced C language: detailed explanation of user-defined types

catalogue structural morphology 1. Declaration of structure 1.1 basic knowledge of structure 1.2 declaration of structure 1.3 special declaration 1.4 self reference of structure 1.5 definition and initialization of structure variables 1.6 structure memory alignment 1.7 modify the default alignment number 1.8 structural transmission pa ...

Posted by Gast on Tue, 12 Apr 2022 06:31:26 +0300