public void makeDotFile() {
        treeStr = new ArrayList<String>();
        //System.out.println("SSS: " + root.getKey());
        treeStr.add(" #This file is automatically generated. Use the bin file.");
        treeStr.add("digraph BinTree{");
        //treeStr.add("dpi=\"300\";");
        // treeStr.add("graph[height=1000, width=1000];");
        runTree(root);
        treeStr.add("}\n");
        String dirName = "./img/";
        String fileName = "tree" + System.currentTimeMillis() + ".dot";
        PrintWriter file;
        try {
            File fileTmp = new File(dirName);
            if (!Files.exists(Paths.get(fileTmp.getPath()))) {
                Files.createDirectories(Paths.get(fileTmp.getPath()));
            }
            fileTmp.createNewFile();
            fileTmp = null;
            file = new PrintWriter(new FileOutputStream(dirName + fileName));
            for (int i = 0; i < treeStr.size(); ++i) {
                file.println(treeStr.get(i));
            }
            file.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }


    }