public static void printOrder(String words[]){
        DirectedGraph graph = new DirectedGraph();
        int size = words.length;
        Map<Vertex, List<Vertex>> edgeMap = graph.getAdjacencys();
        graph.getVertexSet().add(new Vertex('a'));
        graph.getVertexSet().add(new Vertex('b'));
        graph.getVertexSet().add(new Vertex('c'));
        graph.getVertexSet().add(new Vertex('d'));
        // Process all adjacent pairs of words and create a graph
        for (int i = 0; i < size - 1; i++){
            // Take the current two words and find the first mismatching character
            String word1 = words[i];
            String word2 = words[i+1];
            for (int j = 0; j < Math.min(word1.length(), word2.length()); j++)
            {
                // If we find a mismatching character, then add an edge
                // from character of word1 to that of word2
                if (word1.charAt(j) != word2.charAt(j)){
                    Vertex vertex1 = new Vertex(word1.charAt(j));
                    Vertex vertex2 = new Vertex(word2.charAt(j));
                    if(!edgeMap.containsKey(vertex1)){
                        edgeMap.put(vertex1, new ArrayList<Vertex>());
                    }
                    edgeMap.get(vertex1).add(vertex2);
                    break;
                }
            }
        }

        // Print topological sort of the above created graph
        TopologicalSort sortUtil = new TopologicalSort();
        Vertex[] result = sortUtil.topologicalSort(graph);
        for (Vertex vertex : result) {
            System.out.println(vertex.getName());
        }
    }