Data structure C + + version-figure

Source: Internet
Author: User

I. Concepts and CLASSIFICATIONS

Second, the storage structure of graphs

1. Adjacency Matrix

Vertex:

Arc:

Side:

An expression statement:

2. adjacency table

Inverse adjacency table:

3. Cross linked list

4. Adjacent Multiple tables

The concept of weights and the traversal of graphs

Weight value:

Graph traversal:

1. Depth-First search

2. Breadth-First Search

3. Minimum spanning Tree of graphs

1) Premium Manaus algorithm

2) Kruskal algorithm:

Iv. complementary points of knowledge

1. A review of the course:

The deepest feeling to me is:

1. First write the code ideas in Chinese, then one by one to write;

2. First think about the condition of the function end;

3. If the writing process, encountered some difficult to solve the small function, it is first functional, and then complete the function;

2. How to prepare algorithms and interviews

In addition to the daily algorithm exercises, for the small partners looking for work, how to better in the interview process in the algorithm to stand out or there are traces to follow. From the nine-chapter algorithm that can be summed up as follows:

1. The interview process should be properly communicated
2. Talk about your own understanding after you hear the question
3. Communicate the details of the issue with the interviewer
4. Tell the interviewer his own ideas or algorithms
Although the practice algorithm is biased towards the algorithm itself, good code style is necessary. The rough can be divided into the following points:

Code blocks can be three chunks: Exception handling (empty string and boundary handling), body, return

Code style (refer to Google's programming language specification)

1. Name of variable name (meaningful variable name)
2. Indent (statement block)
3. Spaces (operator side)
4. Code readability (even if the IF statement has only one sentence to add curly braces)

The reference given in the Code encyclopedia

In the process of the actual combat algorithm, we can take the following strategies:

1. Summary of similar topics in classification
2. Identify template programs suitable for the same class of topics
3. Master the basic problem

Data structure C + + version-figure

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.