[Leetcode] 269. Alien Dictionary
Problems: https://leetcode.com/problems/alien-dictionary/
Solution:
Topological Sort
建立拓扑图并寻找所有字符的入度(buildGraph),再寻找入度为0的字符取出,邻接字符入度减一(bfs)
class Solution {
public String alienOrder(String[] words...
原创
2019-10-11 08:41:18 ·
252 阅读 ·
0 评论