"Summer Vacation" basic data structure Knowledge point summary carding

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.