Tree dp – a super practical data structure

? 1. Concept introduction Tree DP is dynamic programming based on trees as a model. Mainly use the substructure brought by the tree itself (the parent-child relationship on the tree) to perform state transfer. Generally, the DP value of the parent node is derived from the DP value of the child node. 2. Detailed explanation […]

Data structure – headed two-way circular linked list

Hello, I’m Yui. Foreword Speaking of linked lists, we talked about singly linked lists before, but there are more than one types of linked lists, if you want to classify them. Linked lists can be divided into headed or non-headed, one-way or two-way, cyclic or non-cyclic, which means that there should be a total of […]

Data structure red-black tree (RBTree)

Data structure red-black tree (RBTree) Article directory Data structure red-black tree (RBTree) 1. The concept of red-black trees 2. Properties of red-black trees 3. Definition of red-black tree nodes 4. Red-black tree structure 5. Insertion operation of red-black tree 1. Insert new nodes according to the tree rules of binary search 2. Check whether the […]

8. Data structure-string, encoding set

Coding table Chinese coding table ? Mapping of numbers to Chinese single characters. Chinese characters can only use multi-byte 2 bytes, and there are always 65535 states. Common Chinese encodings include GB2312, GBK, GB18030, and BIG 5. ? All encoding tables are compatible with single-byte ASCII tables. UNICODE ? Multi-byte, one encoding table solves the […]

[C Language] Memory issues related to structures (2/2)

This learning goal 1.Structure memory alignment (hot interview questions) 2.Structure implementation bit segment Article directory This learning goal 1.Structure memory alignment (hot interview questions) 2.Structure implementation bit segment 1. Structure memory alignment 1.What rules exist for memory alignment? 2.Why does memory alignment exist? 1.1 Memory alignment rules 1.2 What is the significance of memory alignment […]

C language data structure-time complexity and space complexity

1. What are time complexity and space complexity? 1.1 Algorithm efficiency Algorithm efficiency analysis is divided into two types: the first is time efficiency, and the second is space efficiency. Time efficiency is called time complexity, while space efficiency is called space complexity. Time complexity mainly measures the running speed of an algorithm, while space […]

[Data structure] Simulation implementation of stack and queue (implemented in two ways)

Foreword About the author: Come on, Xu Xing, currently a sophomore, currently learning C++, Data Structure, etc. Author’s homepage: Come on, Xu Xing’s homepage ?This article is included in: Re-recognizing the advanced column of C Code Warehouse: Rising Sun 1 Everyone is welcome to like Collect ? Follow! Learning objectives: This blog will learn about […]

ST table (Spars table) of doubling ideas and data structures

ST table (Spars table) of doubling ideas and data structures **ST table is a data structure based on the idea of doubling and used to solve the problem of repeatable contribution. ** First, understand what the idea of doubling is. The doubling algorithm, as the name suggests, is to multiply by a power of 2. […]