摘要:
既然要学习算法,就要学习到它的精髓,才能够使用起来得心应手。 我还是远远不够啊。 早就知道,dijkstra 算法可以用优先队列优化,我却一直不知道该怎样优化。当时,我的思路是这样的:假设有n个顶点,将这n个顶点的id和距原点的距离放在结构体内,再将这n个结构体放入优先队列中,堆顶是距源点距离最小的 阅读全文
摘要:
You are given an undirected graph consisting of nn vertices and mm edges. Your task is to find the number of connected components which are cycles. He 阅读全文