Basic data structure Knowledge point summary carding
Data:
Stacks, queues (deque), linked lists, trees, and two-fork trees, graphs
Algorithm:
1, the tree traversal pre_order in_order post_order: Recursive completion
2, according to In_order and another traversal tree: Pre_order|post_order Looking for root node, in_order judgment left and right subtree, recursive processing.
3, according to the BFS and Dfs tree: the location of the BFS sequence to determine the node relationship, Shun Dfs sequence for each node to establish a relationship. The application stack records the parent node.
4, DFS seek connectivity block
5, BFS to find the shortest way: applicable to the Power map, time complexity O (n)
6, topology sort: DFS. Can be used to determine if there is a ring in the graph.
7, the European pull circuit.
Examples:
6-2 rails: Application of stacks + simulation
6-3 matrix chain Multiplication: The application of the stack computes a simple expression.
6-4 tragic text: Linked list application + simulation. Details, the initial situation to think well.
6-5 Moving box: Doubly linked list + simulation. " Append tags to complex operations and modify other actions "
6-6 Ball Drop: Analog All-in-one simulation of the last ball
6-8 Tree: According to the sequence traversal and post-order traversal tree +dfs.
6-9 days Flat: Smart recursion, return value
6-10 fallen leaves: recursively according to position.
6-14 BFS Search Path + node information dir
6-15 Ordering tasks: Toposort
6-17 See picture Write tree: Recursive read-in + print.
6-19 Self-assembly: searching for the ring in the +toposort graph according to the square composition
6-20 ideal path: with T as the starting point of the BFS structural hierarchy + Output the minimum color ordinal path according to the hierarchy
Print_ans: According to the level of consideration, the current level of all the edges of the minimum number of nodes into the next level to consider the sequence
"Summer Vacation" basic data structure Knowledge point summary carding