摘要:
package com.exercise.test; public class Main { public static void main(String[] args) { Link link = new Link(); link.add(1); link.delete(1); link.prin 阅读全文
摘要:
1003 Emergency (25 分) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered citie 阅读全文
摘要:
对图的遍历方式,我总是觉得BFS比DFS要易于理解,因此我也总是倾向于使用BFS去解决问题。但是,DFS具有在某些场景中(如求解可能的路径)比BFS更有优势,到最后也是逃不过递归的命。 以下是《算法导论》中给出的图的DFS伪码: DFS(G) for each vertex u in G.V u.c 阅读全文
摘要:
With highways available, driving a car from Hangzhou to any other city is easy. But since the tank capacity of a car is limited, we have to find gas s 阅读全文