Question: Design a Java program to read the file system beneath a particular folder, and store it in a tree data structure. Description: Requirements: the program

Design a Java program to read the file system beneath a particular folder, and store it in a tree data structure.

Description:

  • Requirements: the program should be able to look at a folder and its tree of subfolders, and construct a tree data structure to represent it. Each node in the tree corresponds to a folder in the file system and should contain the number of files, the total size of the files, the folder's name, and a list of child folders
  • the program should read the name of the folder to scan, scan the folder's subtree, then output the tree in a way that shows the tree hierarchy e.g., one line per tree node, and indent each node appropriately
  • Hint: it should use recursion both in the scanning part of the program, and the part that outputs the tree

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!