Article launch and subsequent updates: https://mwhls.top/1034.html For new updates, please go to mwhls.top see. There is no picture / format error. Please check the first page of the article at the top.
Data structure Exercise directory
Single choice questions
If the head of the single linked list that does not take the lead no ...
Posted by james182 on Tue, 03 May 2022 16:20:34 +0300
Reverse linked list: JZ24
Title Link OJ link
Title Description:
Given the head node phead of a single linked list (the head node has a value, for example, in the figure below, its val is 1) and the length is n, after reversing the linked list, return to the header of the new linked list. Data range: 0 ≤ n ≤ 1000 Requirements: spac ...
Posted by lilsim89 on Tue, 03 May 2022 14:22:36 +0300
catalogue
1, Principle of linked list
1. What is a linked list
2. What is a single linked list
3. Comparison between sequence list and linked list
2, Implementation of single linked list
1. Definition of single linked list
2. Create a linked list node
4. Single linked list data is inserted in the header
summary
1, Principle of link ...
Linear structure and nonlinear structure
Sparse array SparseArray
demand
Recording the position of the chessboard can be saved with a binary array, but it will be found that recording a lot of meaningless data and a lot of space waste can be optimized with a sparse array
introduce
Sparse array is to compress redundant data The firs ...
Posted by billy_111 on Mon, 02 May 2022 15:25:11 +0300
[problem description] true topic of postgraduate entrance examination: given a binary tree, it is required to traverse the binary tree from bottom to top by layers. The access order of each layer is from left to right, and each layer outputs a separate line.
[input form] a binary tree represented by a generalized table. The node element type i ...
✨ preface ✨
🎓 Author: [leader]
☕ The level of bloggers is limited. If there is any error, please correct it.
📌 Opportunities are always reserved for those who are prepared. The harder you work, the luckier you are!
💦 Navigation assistant 💦
catalogue
Linear table
Sequence table
Concept and structure of ...
Posted by new2phpcode on Sun, 01 May 2022 20:10:01 +0300
If you really can't understand it, memorize it by rote. If you don't want to memorize it, treasure it
Chapter I bubble sorting
Bubble Sort is also a simple and intuitive sorting algorithm. It repeatedly visits the sequence to be sorted, compares two elements at a time, and exchanges them if they are in the wrong order. The work of visiti ...
Design the smallest stack, that is, there are the basic operations of the stack, push, pop, peek, and the function of returning the minimum value in the stack, getMin
Tip: previously, we said that the system stack can push, pop and peek normally Now we need to design a minimum stack, and the o(1) speed returns the minimum value in the current ...
Posted by dragon_sa on Sun, 01 May 2022 01:52:25 +0300
Monotone stack
First question
The implementation class is typedef and implements this class with array or int or other classes
typedef struct {
int stack[10000];
int stacktop;
int minstack[10000];
int minstacktop;
}MinStack;//Auxiliary stack, the minimum value of stack top storage;
MinStack* minStackCreate()
{
MinStack* ...
Posted by davitz38 on Sat, 30 Apr 2022 20:38:16 +0300