Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Directory Tree In this assignment, students are required to implement an operati

ID: 3532073 • Letter: D

Question

Directory Tree

In this assignment, students are required to implement an operating system command

that displays the tree structure of a folder or directory. The program asks the

user to enter a folder name. Next, the program traverses the tree hierarchy of this

folder in a preorder traversal to retrieve the children folders or files in the specified

folder. As the hierarchy is being traversed, the names of the subfolders or files are

being displayed in an indented fashion where the amount of indentation reflects

the hierarchy level of the displayed subfolders or files. This command should produce

an output similar to the tree command in the DOS operating system. The

figure below shows a display of a partial output of the tree command.

Explanation / Answer

Syntax


TREE Drive: Path /f /a

Examples

tree

List a tree listing of the current drive. Below is a basic example of what a directory may look like.

C:.
????Common
????Director
????Flash
????Shockwave 8
? ????DswMedia
? ????Prefs
? ????Xtras
????update

Drive:Path Drive and directory containing disk for display of directory structure. /f Displays file names in each directory. /a ext characters used for linking lines, instead of graphic characters. /a is used with code pages that do not support graphic characters and to send output to printers that do not properly interpret graphic characters.
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote