MindMap Gallery Overview of data structures and algorithms
A mind map of algorithms and data structures as a whole
Edited at 2020-06-04 23:28:51Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Avatar 3 centers on the Sully family, showcasing the internal rift caused by the sacrifice of their eldest son, and their alliance with other tribes on Pandora against the external conflict of the Ashbringers, who adhere to the philosophy of fire and are allied with humans. It explores the grand themes of family, faith, and survival.
This article discusses the Easter eggs and homages in Zootopia 2 that you may have discovered. The main content includes: character and archetype Easter eggs, cinematic universe crossover Easter eggs, animal ecology and behavior references, symbol and metaphor Easter eggs, social satire and brand allusions, and emotional storylines and sequel foreshadowing.
[Zootopia Character Relationship Chart] The idealistic rabbit police officer Judy and the cynical fox conman Nick form a charmingly contrasting duo, rising from street hustlers to become Zootopia police officers!
Overview of data structures and algorithms
data structure
data structure It is the organization, management and storage of data. Its purpose is to access and modify data efficiently.
linear structure
Including arrays, linked lists, and stacks, queues, and hash tables derived from them
Tree
The more representative one is the binary tree, from which data structures such as binary trees are derived.
picture
Other data structures
Transformed from basic data structures to solve certain specific problems
Jump list, hash linked list, bitmap, etc.
algorithm
In the computer field, an algorithm is a series of program instructions used to solve specific computational and logical problems.
Judgment of algorithm pros and cons
time complexity
Time complexity comparison
space complexity
Common space complexity
constant space
O(1)
linear space
O(n)
Two-dimensional space
O(n^2)
recursive space
Recursion is a special scenario. Although variables or collections are not explicitly declared in recursive code, the computer When a program is executed, a memory is allocated specifically to store "method calls".
"Method call stack" includes two behaviors: push and pop.
The memory space required to perform recursive operations is proportional to the depth of the recursion.
The space complexity of a purely recursive operation is also linear. If the recursion The depth of is n, then the space complexity is O(n)
progressive representation
If it is a constant magnitude, use the constant 1 to represent
Keep only the highest order terms in the function
If the highest order term exists, the coefficient before the highest order term is omitted.
For example
The trade-off between time and space
Most of the time, time complexity is more important. We would rather allocate more memory space to improve the execution speed of the program.
Classic ideas in algorithm design
greedy algorithm
understand
Similar to change in daily life, each time the banknote with the largest denomination is selected, and the total amount of the banknotes that have been selected does not exceed the amount payable, the banknotes are given to the other party. This method is called a greedy algorithm.
Problem-solving characteristics
The problem has at least one optimal solution. Only in this way is it possible to construct a set of candidate solutions for solving the problem.
As the problem is solved, two other sets will be established. One set (assumed to be set a) is composed of candidate solutions that have been selected and meet the requirements of the problem. The other set (assumed to be set b) is composed of candidate solutions that have been selected. But it is composed of candidate solutions that do not meet the requirements of the problem.
Set a ultimately contains the solution to the problem. When no solution appears in set a, at least one candidate solution remains in the set of candidate solutions to the problem.
solvable classic problems
Minimum spanning tree problem for graphs (Kruskal's algorithm and Prim's algorithm)
Shortest path problem for graphs (Dijkstra's algorithm)
The problem of average time for minimum task execution
backpack problem
divide and conquer
understand
When calculating multiplication, instead of multiplying two numbers directly, one of the multipliers is "decomposed". This decomposition and solution method is called the divide and conquer method.
It is a top-down algorithm
Divide the problem into sub-problems one by one, and solve the original problem by solving the sub-problems.
Problem-solving characteristics
The entire problem can be decomposed into two or more smaller sub-problems
Solving each subproblem is similar to solving the entire problem
If the size of the sub-problem is still quite large and it is inconvenient to solve the sub-problem, then use the divide-and-conquer method to solve the sub-problem.
solvable classic problems
infectious disease issues
Binary search and quick sort
Matrix multiplication
Tower of Hanoi problem
dynamic programming
way of thinking
Avoid solving the same problem twice
It is a bottom-up design method
Problem-solving characteristics
Algorithms need to solve a lot of repetitive work and calculate a lot of repetitive data.
At least some new values can be combined from already calculated values
The problem must be of a certain scale so that the benefits of dynamic programming algorithms can be highlighted
When using the divide-and-conquer method to divide sub-problems, the relationships between sub-problems are unclear and intersect with each other. The solution of a subproblem is related to multiple solved subproblems
solvable classic problems
Fast Fourier problem
Optimal segmentation of polygons
Change problem
shortest path problem
backpack problem
Chained matrix multiplication
Backtracking
It is an optimized exhaustive method
Problem-solving characteristics
The problem can be divided into several unrelated sub-problems
Several subproblems have similar solutions
If the subproblem can still be divided, the edge continues to divide the subproblem.
solvable classic problems
maze problem
Eight Queens Problem
Knight travel problem
Depth first traversal of graph
Probabilistic algorithm
substance
are algorithms that produce different results for the same input
solvable classic problems
Buffon's Needle Problem
Verify matrix multiplication
prime number test
Factoring large integers