Question Details

[answered] Assignment 3: File Systems The common computer file system


This is an assignment from File Systems(Tree data structures) in C#. Can someone please help me with this question?


Assignment 3: File Systems The common computer file system is similar to a tree where each node represents a directory that contains

 

0 or more files, and 0 or more links to subdirectories.

 

To implement such a file system, a data structure called the leftmost-child, right-sibling is often used.

 

The leftmost child refers to the first subdirectory of a node, and the rightmost child refers to the next

 

directory on the same level as the node (see Figure 1). In this case, the root directory has three files (P, Q

 

and R) and three subdirectories (A, B and C). Note that directory names can be repeated as long as they

 

do not appear as siblings. Similarly, file names can be repeated as long as they do not appear in the same

 

directory.

 

The primary task of this assignment is to design, implement, and test a file system using the leftmostchild, right-sibling as the data structure and where the behaviour of the file system is defined by the

 

methods in Figure 2 (next page). Each method in FileSystem is worth 7 marks, except the constructor

 

which is worth 3 marks.

 

Figure 1 Directory Name: /

 

Files: P, Q, R Directory Name: A

 

Files: S Directory Name: B

 

Files: T, U Directory Name: C

 

Files: Directory Name: D

 

Files: V, W Directory Name: A

 

Files: X, Y Directory Name: F

 

Files: Y, Z Figure 2

 

class Node

 

{

 

private string directory;

 

private List<string> file;

 

private Node leftMostChild;

 

private Node rightSibling;

 

...

 

}

 

public class FileSystem

 

{

 

private Node root;

 

/ Creates a file system with a root directory

 

public FileSystem( ) { ... } / / Adds a file at the given address

 

Returns false if the file already exists or the path is undefined; true otherwise

 

public bool AddFile(string address) { ... } / / Removes the file at the given address

 

Returns false if the file is not found or the path is undefined; true otherwise

 

public bool RemoveFile(string address) { ... } / / Adds a directory at the given address

 

Returns false if the directory already exists or the path is undefined; true otherwise

 

public bool AddDirectory(string address) { ... } / / Removes the directory (and its subdirectories) at the given address

 

Returns false if the directory is not found or the path is undefined; true otherwise

 

public bool RemoveDirectory(string address) { ... }

 

/ Returns the number of files in the file system

 

public int NumberFiles( ) { ... }

 

// Prints the directories in a pre-order fashion along with their files

 

public void PrintFileSystem( ) { ... } } For each of the methods above, the address for a directory or file is given in absolute terms (i.e. given in

 

full from the root). For instance, the address of a directory or file is stated as:

 

/ADirectory/BDirectory/CDirectory

 

/ADirectory/BDirectory/CDirectory/AFile Your program will need to parse the given address to determine which path to follow in the file system.

 

What to Submit

 

As usual, submit the source and executable files as well as the test results both digitally and in hard copy.

 

Grading Scheme

 

File class

 

Parsing the address

 

Methods of FileSystem

 

Main (Interface)

 

Testing

 

Inline documentation 5%

 

10%

 

45%

 

15%

 

15%

 

10%

 


Solution details:
STATUS
Answered
QUALITY
Approved
ANSWER RATING

This question was answered on: Sep 18, 2020

PRICE: $15

Solution~0001005019.zip (25.37 KB)

Buy this answer for only: $15

This attachment is locked

We have a ready expert answer for this paper which you can use for in-depth understanding, research editing or paraphrasing. You can buy it or order for a fresh, original and plagiarism-free copy from our tutoring website www.aceyourhomework.com (Deadline assured. Flexible pricing. TurnItIn Report provided)

Pay using PayPal (No PayPal account Required) or your credit card . All your purchases are securely protected by .
SiteLock

About this Question

STATUS

Answered

QUALITY

Approved

DATE ANSWERED

Sep 18, 2020

EXPERT

Tutor

ANSWER RATING

GET INSTANT HELP/h4>

We have top-notch tutors who can do your essay/homework for you at a reasonable cost and then you can simply use that essay as a template to build your own arguments.

You can also use these solutions:

  • As a reference for in-depth understanding of the subject.
  • As a source of ideas / reasoning for your own research (if properly referenced)
  • For editing and paraphrasing (check your institution's definition of plagiarism and recommended paraphrase).
This we believe is a better way of understanding a problem and makes use of the efficiency of time of the student.

NEW ASSIGNMENT HELP?

Order New Solution. Quick Turnaround

Click on the button below in order to Order for a New, Original and High-Quality Essay Solutions. New orders are original solutions and precise to your writing instruction requirements. Place a New Order using the button below.

WE GUARANTEE, THAT YOUR PAPER WILL BE WRITTEN FROM SCRATCH AND WITHIN YOUR SET DEADLINE.

Order Now