ACM third week of training summary

Learning content: graph algorithms, minimum spanning tree (Kruskal, prim), the shortest path (Dijkstra, bellman ford, Floyd) , the dictionary tree, tree line, topological sorting, disjoint-set.
Summary: This week is also a lot to learn content, so it does not learn thoroughly such as topological sorting, and other types of disjoint-set. But the difficulty of thinking this week is not the subject of last week's difficult, the basic process is this: remember to read good template algorithm → → → read the topic converted into graph theory → apply the template to complete most of the questions it. But there are still many written very difficult problem, D title blabla not know what it is required, read only to find solution to a problem is to ask whether the maximum path positive ring, with the average shortest path exactly the opposite. E title beginning with the shortest path dijkstra but do not know how to obtain the smallest maximum jump distance, read other people's ideas is most to the maintenance of a dijkstra method to a point of minimum maximum jump distance d [] array rather than in general terms to apply the template to d [] array as a minimum path to a point, and F may have the same title but different weights are multiple sides, so the input to deal with it, if the minimum weight to be effective, it is a little pit.
One problem may have several different algorithms can be solved, the general minimum spanning tree I used kruskal + and Chagall set write faster efficiency; shortest path if there is no negative weight, then directly dijkstra, there are negative weights are used SPFA, folyd most simple but also the most likely time out, triple loop and seeing them will feel TLE. In fact kruskal can also use the priority queue optimization

Guess you like

Origin www.cnblogs.com/megadeth/p/11330553.html