摘要:
总而言之 BFS的方法对于静态的图的联通块问题比较好解 Union Find 解决动态的图的联通块的问题 1. BFS TIME: O(MxN) Space: O(min(M,N)) because in worst case where the grid is filled with lands, 阅读全文
摘要:
*** Do I need to consider multi-threading?*** HashMap等数据结构都不支持多线程。 都是non-Sychronized 如果要支持muti-thread就要加sychronization. 简单来说就是加锁 ConcurrentHashMap - 用 阅读全文
摘要:
public String alienOrder(String[] words) { //because the char has a topological order, we record how many char to current char // a (b ,c, d) after it // b (c ,d ) after it ... 阅读全文