public static void main(String args[]) {
        AlientDictionary ad =  new AlientDictionary();
        String[] words1 = {"zy","zx"};
        String[] words = {"wrt", "wrf", "er", "ett", "rftt"};
        String[] words2 = {"wrtkj","wrt"};
        String result = ad.alienOrder1(words2);
        System.out.print(result);


        //w -> e
        // e -> r
        //t -> f
        //r -> t
        //
    }
degree is only used for BFS. Not for DFS.
src/com/interview/graph/AlientDictionary.java