Diagram of javascript--data structure and algorithm

Source: Internet
Author: User
Algorithms for graphs and graphs:
The definition of a graph consists of a set of edges and a set of vertices.
For example, the map, each town is the vertex, the road is the edge, by the vertex pair to define (town 1, Town 2) short (V1,V2) vertex also has the weight--cost.
Basic concepts:
Forward graph: The vertex pairs of graphs are ordered. --With arrows (common flowchart)
No map: The graph is unordered. --No arrows pointing.
Path: A series of vertices in the graph.
Path Length: The number representation between the first vertex and the last vertex in the path.
Ring: The path that points to the vertex of itself. The length of the ring is 0;
Circle: The path of at least one edge, and the first and last vertex of the path are the same.
Simple circle: Whether it is a graph or a non-graphic, as long as there is no repeating edge or repeating the vertex circle.
Ordinary circle: The other vertices of the path have a repeating circle except the first and last vertices.
Strong connectivity: There are paths between the two vertices, which are strongly connected and vice versa.
Strongly connected graphs: all vertices of a forward graph are strongly connected.
First, the graph class:
Figure and tree, the binary tree is very similar. A diagram can be created in a number of ways, and the node represents a vertex. But dealing with an object-based approach can cause problems because the graph grows to a very large extent. The structure of the tree will be inefficient.

Diagram of javascript--data structure and algorithm

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.