Algorithms and Data Structures

Algorithms and Data StructuresAssignment – Generalized TreesIntroductionThe file system on most modern operating systems is organized as a generalized tree structure. The nodes of the tree are regular files and subdirectories. The subdirectories provide hierarchical structure, as they can contain other subdirectories as well as regular files.For this assignment, write a Java program that recursively traverses the file system starting at a fully qualified subdirectory. The subdirectory must be provided as a command line parameter. When processing begins, the first line of output is the fully qualified subdirectory.For each subdirectory encountered, get a list of the files in that subdirectory. For each entry in the list, if it is a regular file, output the file name and extension. Do not include the path name; just the file name and extension. If the file is a subdirectory, output just the subdirectory name; do not include the pathname that precedes the subdirectory name. In either case, after outputting the name, recursively descend into subdirectory and continue. You may recognize this as a pre-order traversal.For each line of output, prefix the file or subdirectory name with indentation that provides a visual indication of the depth of the recursive descent.Students are responsible for· public FileTreeWalk(String pathname)· public String listAllFiles()· public String toString()class FileTreeWalkFileTreeWalk is a Java class used for traversing a file system. In addition to a constructor, the class provides two public methods for traversing the file system, and a public toString method for displaying the traversal results.The public interface to the class follows:public FileTreeWalk (String pathname)The constructor takes a String parameter that specifies a pathname. The pathname is a starting point for the file system traversal. The parameter is either a fully qualified path name, or a relative pathname. Fully qualified pathnames start with an optional drive letter, or a slash. On other operating systems (e.g., Linux, Unix), a fully qualified pathname starts with a slash. Relative pathnames start at the current working directory. In either case, the pathname parameter specifies where the file system traversal is supposed to begin.As FileTreeWalk traverses the file system, it adds file names and subdirectory names to a generalized tree structure that when finished will represent the current state of the file system from the starting point specified by the String parameter, pathname.public String listAllFiles ()

Struggling to find relevant content? Order a custom essay on
Algorithms and Data Structures
Let our experts save you the hassle
Order Now
Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
Sign up, place your order, and leave the rest to our professional paper writers in less than 2 minutes.
step 1
Upload assignment instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
s
Get personalized services with GPA Fix
One writer for all your papers
You can select one writer for all your papers. This option enhances the consistency in the quality of your assignments. Select your preferred writer from the list of writers who have handledf your previous assignments
Same paper from different writers
Are you ordering the same assignment for a friend? You can get the same paper from different writers. The goal is to produce 100% unique and original papers
Copy of sources used
Our homework writers will provide you with copies of sources used on your request. Just add the option when plaing your order
What our partners say about us
We appreciate every review and are always looking for ways to grow. See what other students think about our do my paper service.
Psychology
Excellent!!!!
Customer 452587, July 28th, 2021
Other
great
Customer 452813, June 25th, 2022
Social Work and Human Services
Great Job!
Customer 452587, October 27th, 2021
Other
Great Work!
Customer 452587, March 10th, 2022
Human Resources Management (HRM)
Thanks.
Customer 452701, August 15th, 2023
Nursing
Looks good. Thank you!!
Customer 452525, April 27th, 2022
English 101
I'm glad i came to you guys
Customer 452519, May 11th, 2021
Psychology
Thanks so very much. The paper is well-researched and adequately referenced. You have been of great help during the pandemic!
Customer 452467, January 31st, 2021
Human Resources Management (HRM)
Thank you.
Customer 452701, April 24th, 2023
Other
Great job
Customer 452813, July 27th, 2023
Other
Thank you for a well written paper!!!
Customer 452557, January 19th, 2022
Nursing
They research and provide the best and up-to-date information..
Customer 452707, June 27th, 2023
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat

Good News ! We now help with PROCTORED EXAM. Chat with a support agent for more information