Suppose you wish to make an application that traverses a computer's filesystem and an- alyzes the amount of space (in megabytes) used by all of the various files and directories. Your application must store the following information: • The amount of space used by each individual file. • The total amount of space used by the contents of each directory (folder). For each directory, you need to store the total amount of space used by all files in that directory and all of the files in all of its sub-directories (sub-folders), sub-sub-directories, and so forth. For example: if the only files in the filesystem are: /Users/Mark/Documents/exam.tex (0.014 Mb) /Users/Mark/Documetns/exam.pdf (0.3Mb Mb) /Users/Mark/piratesong.mp4 (2.9 Mb) Then the stored size for /Users/Mark/Documents would be 0.314 Mb (sum of the sizes of the two files in the Documents directory), and the stored size for the directories /Users/Mark, /Users, and / would be 3.214 (sum of the sizes of all three files because they are all stored somewhere under /Users/Mark). This data must be stored in a data structure that you design. That data structure should, as efficiently as possible, support the following operations on the data: • Given the absolute path to a file (e.g. /usr/mark/Documents/exam.pdf), look up the amount of space used by that file. • Given the absolute path to a directory (e.g. /usr/Mark/Documents/ amount of space used by all files in that directory and all of it's sub-directories. videos), look up the • Calculate the total amount of space used by all files with a given extension (e.g. jpeg or .mp3). In your own words, describe a data structure design that would be suitable for storing this data and supporting the operations on it. Justify your design choices. For example, if you choose to use a particular ADT, explain why you think it is the best choice both in terms of why it is appropriate for storing the data and why it will efficiently support the required operations on the data. Do not write Java code. We will not read code and it will not be considered a part of your answer. Describe your data structure in prose. You are encouraged to draw schematic diagrams to illustrate your design and aid in the understanding of its description. Do not rush the composition of your answers. The quality of the logic and reasoning of your iustifications are factore in the assessment of vour ans wers

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Suppose you wish to make an application that traverses a computer's filesystem and an-
alyzes the amount of space (in megabytes) used by all of the various files and directories. Your
application must store the following information:
• The amount of space used by each individual file.
• The total amount of space used by the contents of each directory (folder). For each directory, you
need to store the total amount of space used by all files in that directory and all of the files in all
of its sub-directories (sub-folders), sub-sub-directories, and so forth.
For example: if the only files in the filesystem are:
/Users/Mark/Documents/exam.tex (0.014 Mb)
/Users/Mark/Documetns/exam.pdf (0.3Mb Mb)
/Users/Mark/piratesong.mp4 (2.9 Mb)
Then the stored size for /Users/Mark/Documents would be 0.314 Mb (sum of the sizes of the two
files in the Documents directory), and the stored size for the directories /Users/Mark, /Users, and
/ would be 3.214 (sum of the sizes of all three files because they are all stored somewhere under
/Users/Mark).
This data must be stored in a data structure that you design. That data structure should, as efficiently
as possible, support the following operations on the data:
• Given the absolute path to a file (e.g. /usr/mark/Documents/exam.pdf), look up the amount of
space used by that file.
Given the absolute path to a directory (e.g. /usr/Mark/Documents/
amount of space used by all files in that directory and all of it's sub-directories.
• Calculate the total amount of space used by all files with a given extension (e.g. jpeg or .mp3).
In your own words, describe a data structure design that would be suitable for storing this data
and supporting the operations on it.
videos), look up the
Justify your design choices. For example, if you choose to use a particular ADT, explain why you
think it is the best choice both in terms of why it is appropriate for storing the data and why it will
efficiently support the required operations on the data.
Do not write Java code. We will not read code and it will not be considered a part of your answer.
Describe your data structure in prose.
You are encouraged to draw schematic diagrams to illustrate your design and aid in the understanding
of its description.
Do not rush the composition of your answers. The quality of the logic and reasoning of your
justifications are factors in the assessment of your answers.
Transcribed Image Text:Suppose you wish to make an application that traverses a computer's filesystem and an- alyzes the amount of space (in megabytes) used by all of the various files and directories. Your application must store the following information: • The amount of space used by each individual file. • The total amount of space used by the contents of each directory (folder). For each directory, you need to store the total amount of space used by all files in that directory and all of the files in all of its sub-directories (sub-folders), sub-sub-directories, and so forth. For example: if the only files in the filesystem are: /Users/Mark/Documents/exam.tex (0.014 Mb) /Users/Mark/Documetns/exam.pdf (0.3Mb Mb) /Users/Mark/piratesong.mp4 (2.9 Mb) Then the stored size for /Users/Mark/Documents would be 0.314 Mb (sum of the sizes of the two files in the Documents directory), and the stored size for the directories /Users/Mark, /Users, and / would be 3.214 (sum of the sizes of all three files because they are all stored somewhere under /Users/Mark). This data must be stored in a data structure that you design. That data structure should, as efficiently as possible, support the following operations on the data: • Given the absolute path to a file (e.g. /usr/mark/Documents/exam.pdf), look up the amount of space used by that file. Given the absolute path to a directory (e.g. /usr/Mark/Documents/ amount of space used by all files in that directory and all of it's sub-directories. • Calculate the total amount of space used by all files with a given extension (e.g. jpeg or .mp3). In your own words, describe a data structure design that would be suitable for storing this data and supporting the operations on it. videos), look up the Justify your design choices. For example, if you choose to use a particular ADT, explain why you think it is the best choice both in terms of why it is appropriate for storing the data and why it will efficiently support the required operations on the data. Do not write Java code. We will not read code and it will not be considered a part of your answer. Describe your data structure in prose. You are encouraged to draw schematic diagrams to illustrate your design and aid in the understanding of its description. Do not rush the composition of your answers. The quality of the logic and reasoning of your justifications are factors in the assessment of your answers.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY