MindMap Gallery Design and Analysis of Algorithms
The core points of algorithm design and analysis include several basic algorithm design ideas, which can give us a clear overall understanding of the algorithm and help us better understand the algorithm and take exams. If you don’t have enough time to review, just look at this picture.
Edited at 2021-04-04 15:47:59Avatar 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!
algorithm
basic concept
Sorting Algorithm
binary search
Merge sorting requires auxiliary arrays for the number of element comparisons and assignments.
n
Selection sorting comparison number n(n-1)/2, assignment number range
O(N^2)
insertion sort
The number of comparisons is n-1->n(n-1)/2, and the number of assignments is n-1 more than it.
Given an array, count the number of element comparisons
time complexity
Worst O(n^2)
Best O(n)
Time complexity of various sorting algorithms
blog
bottom-up merge sort
nlogn
Number of comparisons and number of assignments
time complexity
Calculate the number of iterations
Calculate the frequency of basic operations
Element comparison cannot be used as a meta-operation in Merge.
meta operations
Can't find a single meta-operation, you can use multiple, just control the total number of times
Use recurrence relations
space complexity
Four Notations for Complexity
Upper bound O
Nether
Gradually
0
Complexity formula
How to calculate and solve the recursive formula
heap
definition
Correct specification of array representation
label
from left to right
from top to bottom
The parent node is not less than the value of the child node
almost complete binary tree
divide and conquer
binary search
The number of comparisons does not exceed logn, round down and add 1
Time complexity O(logn)
merge sort
Time complexity OH(nlogn)
Space OH(n)
divide and conquer paradigm
divide
governance
combination
Find the median term and the Kth smallest element
Quick sort
Less than on the left, greater than on the right, recursive division
Can write the overall process of division and recursion
time complexity
Worst, already in order
n^2
Best, I choose the middle option every time
nlogn
Matrix multiplication
formula
Matrix [two-dimensional array] represents and fills in data
Time complexity O[H](n^3)
Space complexity O[H](n^2)
dynamic programming
Basic
Divide and conquer and eliminate redundancy
optimal substructure
The optimal solution to the problem contains the optimal solutions to the sub-problems
Determine whether it is the optimal substructure
All point-to-point questions
Recursive
algorithm
Time complexity n^3, space complexity n^2
triangle cutting problem
Matrix chain multiplication
Time n^2
Space n^3
0-1 backpack problem
The meaning and representation of matrix [two-dimensional array]
optimization
chessboard problem
Related analysis
longest common subsequence
Time nm
greedy algorithm
The process of constantly searching for local optimal solutions
proof of correctness
Minimum Spanning Tree·
kruskal
prim
Finding the Minimum Cost Spanning Tree of a Weighted Undirected Graph
TimeO[H](n^2)
shortest path
dijkstra
Find the shortest path in a non-negative length graph
The content of each step of the set of X and Y in the process
process
Two sets X and Y, constantly find the shortest edge between them, and update the C[] array
Time complexity n^2
Bellman-ford
decimal backpack
Ship loading problem
Sort by weight from small to large
Install the small ones first, then the big ones
blog
Event arrangement issues
Proved to be the optimal solution
Backtracking
Basic features of the backtracking method
Nodes are generated by DFS
No need to store the entire search tree
A node may be visited more than once
pruning function
constraint function
bounding function
Avoid invalid searches
Prune subtrees that do not satisfy constraints at extended nodes
Prune subtrees that do not produce optimal solutions
branch boundary
Breadth first or least consumption first
three coloring
recursion
Iterate
child nodes of solution space
3^n
Worst case O(n*3^n)
Currency exchange problem
subtopic
subset sum problem
Graph traversal
DFS
Undirected graph
By the tree
(v,w), w is visited for the first time
Go back to the edge
other sides
directed graph
By the tree
Go back to the edge
w is the ancestor of v. When (v, w), w has been visited
forward edge
w is a descendant of v. When (v,w), w has been visited
across edge
other sides
predfn and postdfn
For V (pre1, post2), W (pre2, post2), judge (V, W)
Undirected graph
By the tree
if pre1 1 = pre2
if post2 1 = post1
Go back to the edge
directed graph
By the tree
if pre1 1 = pre2
if post2 1 = post1
Go back to the edge
pre1 > pre2 and post1 < post2
forward edge
pre1 < pre2 and post1 > post2
pre1 1 != pre2 and post2 1 != post1
across edge
time complexity
If expressed in adjacency list, O[H](m n)
BFS
Undirected graph
By the tree
(v,w), w is visited for the first time
across edge
directed graph
By the tree
Go back to the edge
w is the ancestor of v. When (v, w), w has been visited
across edge
other sides
bfs
Search spanning tree drawing
Traverse serial number annotation
NP
P
There is a problem with polynomial time algorithms
NP
A problem that can verify a correct solution in polynomial time
NPC
There is such an NP problem, and all NP problems can be reduced to it
That is NP==P
NP-hard
All NP can be reduced to it, but it is not necessarily an NP problem
NP complete problem
Hamiltonian cycle problem
traveling salesman problem
Satisflability can satisfy judgment problems
vertex cover
independent set
group
3 can satisfy the problem
3 coloring issues
3D matching problem
partitioning problem
backpack problem
Boxing problem
Collection coverage
multiprocessor scheduling
longest path problem