Data structure note 5: single linked list

Note: this note is organized according to the video content of kingcraft Forum - data structure. 1, Definition Sequence table features: Advantages: random storage and high storage density.Disadvantages: large continuous space is required, and it is inconvenient to change the capacity. Single liUTF-8...

Posted by Aybabtu on Wed, 13 Oct 2021 21:41:26 +0530

subject Here are the head nodes headA and headB of the two single linked lists. Please find and return the starting node where the two single linked lists intersect. If two linked lists have no intersection, null is returned. As shown in the figure, two linked lists intersect at node c1: The tUTF-8...

Posted by deep on Wed, 13 Oct 2021 21:56:46 +0530

1085 PAT unit ranking (25 points)

subject After each PAT test, the test center will publish a ranking list of candidates. Please realize this function. Input format: Enter the first line to give a positive integer N (< = 105), that is, the number of candidates. Then N lines, each line giving the information of a candidate in thUTF-8...

Posted by bnownlater on Thu, 14 Oct 2021 00:01:42 +0530

Brief introduction to queue

Background introduction Recently, I read the big talk data structure again, and here I summarize Chapter 4 - queue. queue Definition: a queue is a linear table that can only be inserted at one end and deleted at the other. The inserted end is called the team head, and the deleted end is calledUTF-8...

Posted by fantasticham on Thu, 14 Oct 2021 11:25:23 +0530

Data structure - stack

1. A practical requirement of stack Please enter an expression Calculation formula: [722-5 + 1-5 + 3-3] Click calculation [as shown below] Excuse me: how does the bottom layer of the computer calculate the result? 2. Introduction to stack Stack (stack)Stack is an ordered list of first in and lUTF-8...

Posted by lajocar on Thu, 14 Oct 2021 11:25:53 +0530

Introduction to mastery of data structure stack

1. What is stack Stack is a linear table with limited operation. It only allows inserting and deleting data from one end. Stack has two storage methods, namely linear storage and linked storage (linked list). One of the most important features of the stack is that the insertion and deletion of UTF-8...

Posted by eb1024 on Thu, 14 Oct 2021 11:59:44 +0530

Introduction and application of cJSON - based on VS and STM32 single chip microcomputer

1, Introduction to cJSON cJSON is a JSON data parser written in C language. It is super portable, portable and single file. It uses MIT open source protocol. There are only two source files for cJSON: 1. cJSON.h 2. cJSON.c When using, you only need to copy these two files to the project directoUTF-8...

Posted by GFXUniverse on Thu, 14 Oct 2021 23:30:02 +0530

lc28. Implement strStr() - KMP algorithm

subject Violent solution For the following two strings: we agree that the first string is text string s and the second string is pattern string P. we use string p to match string s When we use a naive algorithm, the algorithm steps should be as follows: 1. The pointer I of s moves back from 0, UTF-8...

Posted by kidestranged on Thu, 14 Oct 2021 23:42:34 +0530

malloc and free in C language

1, Why malloc in c language Malloc means memory allocate dynamically allocates memory. In order to make up for the shortcomings of static memory allocation, malloc has the following disadvantages: 1. For example, for a traditional one-dimensional array, such as int a[5], the length of the arrayUTF-8...

Posted by owner on Thu, 14 Oct 2021 23:57:53 +0530

Data structure - recursion

1. Recursive application scenario Maze problem (backtracking) 2. Recursive concept To put it simply: recursion is to call yourself. Each time you call, you pass in different variables. Recursion helps solve complex problems while keeping the code clean 3. Recursive call mechanism The recursiveUTF-8...

Posted by SleepyP on Fri, 15 Oct 2021 01:39:42 +0530