Data structure (C language version) -- diagram notes
1. Definitions and basic terms of drawings
①. Definition of graph
Graph G is composed of two sets V and E, marked as G=(V,E), where V is the finite nonempty set of vertices, e is the finite set of vertex pairs in V, and these vertex pairs are symmetrical as edges. V(G) and E(G) usually represent the vertex set and edge set of graph G re ...
Added by theelectricwiz on Sun, 20 Feb 2022 16:17:45 +0200
[ACWing]2188. Upper and lower bounds of passive sink feasible flow
Title address:
https://www.acwing.com/problem/content/2190/
Given a containing
n
n
n points
m
m
For a digraph with m edges, each edge has a lower bound and an upper bound. Find a feasi ...
Added by ajpasetti on Sun, 20 Feb 2022 07:23:11 +0200
Data structure diagram (storage structure)
Definitions and basic terms of drawings
Figure: G=(V, E) Grapg = (Vertex, Edge) V: finite non empty set of vertices (data elements); E: finite set of edges
Undirected graph: each edge is undirected Directed graph: each edge has a direction Complete graph: any two points have an edge connected Sparse gr ...
Added by stormszero on Wed, 16 Feb 2022 06:47:56 +0200
Discrete mathematics experiment II
Experimental topic: solution of spanning tree, loop space and fault set space
Purpose of the experiment:
1. Master the solution method of undirected connected graph spanning tree; 2. Master the solution method of basic loop system and loop space; 3. Master the solution method of basic cut set system and fault set space; 4. Understand the prac ...
Added by amjohnno on Tue, 15 Feb 2022 12:12:35 +0200
Minimum spanning tree and bipartite graph in graph theory (acwing template)
Directory navigation:
Minimum spanning tree:
For a graph with n points, the edges must be greater than or equal to n − 1. The minimum spanning tree is to select from these edges
N-1 edges connect all n points, and the sum of edge weights of these n − 1 edges is the smallest of all schemes
One more thing:
There are n ...
Added by Crave on Tue, 15 Feb 2022 05:56:21 +0200
L2-016 may all lovers in the world be brothers and sisters who have been separated for many years (25 points) (C language) (and collection) (dfs) (test point pit)
subject
L2-016 wish all lovers in the world are brothers and sisters who have been separated for many years (25 points) ha-ha. We all know that intermarriage is not allowed within five clothes, that is, if the nearest common ancestor of two people is within five generations (i.e. myself, parents, grandparents, great grandparents and high grand ...
Added by Slashscape on Mon, 14 Feb 2022 12:41:37 +0200
Shortest path algorithm template (Dijkstra, Bellman_ford, spfa, Floyd)
Summary of shortest path algorithm templates
In graph theory, the graph is directed and undirected, and only the algorithm of the directed graph is considered here. For undirected graphs, we see them as a special kind of directed graph, for all undirected edges
u
↔
...
Added by cougar23 on Sun, 13 Feb 2022 20:04:49 +0200
2022-02-13 swipe questions and punch in every day
2022-02-13 swipe questions and punch in every day
AcWing - Fundamentals of algorithm
897. Longest common subsequence - AcWing question bank
Given two strings A and B with lengths of N and M respectively, find the longest string length of both A subsequence and B subsequence.
Input format
The first line contains two integers N and M.
The s ...
Added by ollmorris on Sun, 13 Feb 2022 06:50:17 +0200
Single source shortest path exercise
Mapping method of single source shortest path
Heat Wave
Title Link: Heat Wave Analysis: for a relatively naked problem, directly build a drawing and set a template, and I will directly use spfa water. Code implementation:
#include<iostream>
#include<queue>
#include<cstring>
using namespace std;
const int N=2510,M=12410; ...
Added by reag27 on Sat, 12 Feb 2022 14:16:52 +0200
Discrete Mathematics Experiment 1
Experiment Title: simple diagramming, judgment of connected graph, Euler graph and Hamiltonian graph
Purpose of the experiment:
Master the definition and judgment method that can be simplified;Master the judgment methods of connected graph and Euler graph;Master the search method of Euler loop;Understand the practical application of Euler cha ...
Added by ungovernable on Sat, 12 Feb 2022 12:34:59 +0200