MindMap Gallery data structure
The data structure was sorted out by myself before the final exam, and some places were not very detailed. Some of them have illustrations and examples, which you can also use to prepare for exams and review.
Edited at 2023-06-05 13:15:04One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
One Hundred Years of Solitude is the masterpiece of Gabriel Garcia Marquez. Reading this book begins with making sense of the characters' relationships, which are centered on the Buendía family and tells the story of the family's prosperity and decline, internal relationships and political struggles, self-mixing and rebirth over the course of a hundred years.
Project management is the process of applying specialized knowledge, skills, tools, and methods to project activities so that the project can achieve or exceed the set needs and expectations within the constraints of limited resources. This diagram provides a comprehensive overview of the 8 components of the project management process and can be used as a generic template for direct application.
data structure
introduction
logical structure
Linear
Linear list, stack, queue, string, array
nonlinear
picture
Tree
storage structure
order
chain
Data operations
Insert, delete, modify, search, sort
Analysis of Algorithms
time complexity
space complexity
linear table
Sequence table
storage
LOC ( ai ) = LOC ( a1 ) L * (i -1)
Operation
Insert and delete (move forward and backward as a whole)
linked list
Single list
Create table
Head plug (in reverse order)
tail plug
insert, delete
Reverse order
Classic question
Whether there is a cycle and determine the intersection point
Whether they intersect and determine the intersection point
speed pointer
Joseph problem
Delete duplicates
Merge linked lists
Is it symmetrical?
Double linked list
circular linked list
static linked list
Don't use pointers
There is maxsize
stacks and queues
stack
sequence stack
chain stack
application
Expression evaluation
queue
chain team
sequential team
False overflow: front-end space cannot be released
circular queue
How to judge if the queue is empty or full
string
storage
order
Fixed length
s[0] stores the string length
Heap allocation
chain
Block chain chunk
pattern matching algorithm
BF
There is backtracking and the speed is slow.
Position the next character of the main string i=i-j 2
KMP
next[j]
Arrays and generalized tables
array
sequential storage
row precedence
Column first
chain storage
Compressed storage of coefficient matrix
triple table
cross linked list
triplet matrix
Triplet with auxiliary vectors
coefficient matrix transpose
compressed transpose
Scan column sequence
Quick transpose
generalized table
Header and footer
get head may be an atom or a table, get tail must be a table
storage
Atomic node
table node
Trees and Binary Trees
nature
Binary tree
nature
n0=n2 1
The left and right child node numbers are 2i, 2i 1 respectively (complete binary tree)
operate
Traverse
recursion
non-recursive
Level traversal
reconstruction
preorder midorder
after middle
Convert
Trees and Binary Trees
Forest and binary trees
clue binary tree
In-order clue binary tree
Huffman tree
make achievements
Choose the two with the smallest weight each time
Compile and code
Left 0 Right 1
sort
Overview
stable/unstable
inside/outside
storage and processing
Sort sequentially (mostly)
Linked list sorting
Address sorting (adding one-dimensional array)
Sorting Algorithm
insertion sort
insert directly
Linear search O(n^2)
Insert in half
O(n^2) The number of comparisons is reduced, but the number of moves is not reduced.
2-way insertion
table insert
Add pointer component to each record
The pointer content is changed to the sorted successor address.
Hill sort (shrinking increment)
unstable
swap sort
Bubble Sort
Constantly comparing pairs
Quick sort
process
unstable
selection sort
Simple selection sort
Each time, find a minimum value and exchange it with the front of the column to be sorted.
Tournament sorting (tree selection sorting)
complete binary tree
It can be agreed that the node is smaller on the left and larger on the right
Heap sort
Build a pile
sort
Time efficiency O(nlog2n), space efficiency O(1), unstable
merge sort
Continuously merge into ordered subsequences
Time efficiency O(nlog2n), space efficiency O(n)
Radix sort
Multiple keywords sorted by different bit values
sorting method
Most significant bit first MSD
Least Significant First LSD
storage method
order
chain
Find
static lookup table
Sequential (linear) search
ASL=(n 1)/2
Search in half in ordered sequence list
ASL=[log2 n] 1
Index sequence table block search
ASL=index ASL sequence table ASL
Static tree table lookup (suboptimal tree)
Performance analysis
Find
Sorted sequence list O(log2 n)
insert delete
Linked list O(1)
Dynamic lookup tree table
Binary search (sort) tree
insert
delete
leaf
Change the parent corresponding pointer field to empty
Only left/right subtree
The parent pointer field points to the remaining left/right subtree
There are left and right subtrees
Binary balanced tree AVL tree
balanced rotation
Single rotation (straight line)
Double rotation (polyline)
Hash table (hash table)
Hash function construction
direct addressing
Linear function Hash(key)=a*key b
Divide and leave remainder
Hash(key)=key mod p
p is a prime number or a composite number with a prime factor not less than 20
digital analysis
Get certain keywords
Find the center of the square
After squaring, take the middle digits
fold
Split, superposition and sum
Split, transpose, sum
random number
Hash(key)=random(key) pseudo-random number
handling conflicts
Open addressing (open address)
Linear probing (finding the next empty address)
Hi=(Hash(key) di) mod m (di is the increment, m is the table length)
secondary detection
pseudo-random detection
di is a pseudo-random sequence
chain address
Thought
ASL calculation (as in the above example)
(Re)Double Hash Function
If a collision occurs, calculate another hash function
Create a public overflow area
Performance analysis
ASL is related to the filling factor (number/length of data filled in)
picture
the term
There are undirected, completely, (strongly) connected graphs (components)
Adjacent points, arc head and tail, ingress and egress
path, path length, simple path
storage structure
Adjacency matrix (array)
Undirected graph
directed graph
weighted graph
Boundless is infinite
Adjacency list (chained)
Not unique
Directed graph, out-degree adjacency list and inverse adjacency list
cross linked list
adjacency multiple list
Traverse
Breadth-First BFS (Queue)
Depth-first DFS (recursive)
Adjacency list (sparse graph)
Adjacency matrix (dense graph)
Each call gets a connected component
connectivity
Minimum Spanning Tree MST
n vertices, n-1 edges, minimum weight
Prim algorithm
Merge vertices (dense net)
Kruskal algorithm
Merge edges without generating loops (sparse network)
shortest path problem
Dijkstra's algorithm (source point to each vertex)
Floyd algorithm (between pairs of vertices)
application
Topological sorting (no loops)
Select a vertex with an in-degree of 0, and the in-degree of the arc vertex is -1
Critical Path