2018年12月26日

Union Find算法总结

摘要: 基本思想: Union Find问题主要用于解决分块问题,对于Union Find问题一般也可以用DFS或BFS解决,但用Union Find更方便一些。该算法一般包含两个函数,Union和Find函数,Find函数就是依据图或树的拓扑关系找到其根节点,Union则是将两个子图或子树合并成一个树。 阅读全文

posted @ 2018-12-26 15:10 周浩炜 阅读(408) 评论(0) 推荐(0) 编辑

Leetcode 269. Alien Dictionary

摘要: Problem: There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of non-e 阅读全文

posted @ 2018-12-26 14:56 周浩炜 阅读(119) 评论(0) 推荐(0) 编辑

导航