diff --git a/Graphs/DFS.java b/Graphs/DFS.java new file mode 100644 index 0000000..71d5f3a --- /dev/null +++ b/Graphs/DFS.java @@ -0,0 +1,30 @@ +import java.io.File; + +class FileUtils +{ + public static void listFilesRecursive(File root) + { + File[] listOfFilesAndDirectory = root.listFiles(); + + if (listOfFilesAndDirectory != null) + { + for (File file : listOfFilesAndDirectory) + { + if (file.isDirectory()) { + listFilesRecursive(file); + } + else { + System.out.println(file); + } + } + } + } + + public static void main(String args[]) + { + String dir = "C:\\Users"; + File rootDir = new File(dir); + + listFilesRecursive(rootDir); + } +} diff --git a/Graphs/FileUtils.class b/Graphs/FileUtils.class new file mode 100644 index 0000000..acdc15a Binary files /dev/null and b/Graphs/FileUtils.class differ