write a program to simulate managing files on disk
Hal lo,
How to write a program to simulate managing files on disk.Define the disk as a one-dimensional array disk of size numOfSectors*sizeOfSector, where sizeOfSector indicates the number of characters stored in one sector. A pool of available sectors is kept in a linked list sectors of three-field structures: two fields to indicate range of available sectors and one next field. Files are kept in a linked list files of four-field structures: file name,the number of characters in the file, reference to a linked list of sectors where the contents of the file can be found, and the next field.
In the first part, implement methods to save and delete files. Saving files requires claiming a sufficient number of sectors from pool,if available. The sectors may not be contiguous, so the linked list assigned to the file may contain several nodes. Then the contents of the file have to be written to the sectors assigned to the file. Deletion of a file only requires removing the nodes corresponding with this file(one from files and the rest from its own linked list of sectors) and transferring the sectors assigned to this file back to pool. No changes are made in disk.
If some one know how to do this please help me. Thank you
<Data Structures And Algorithms in Java By Adam Drozdek page 125>
Re: write a program to simulate managing files on disk
What part of this are you having trouble with?
The biggest difference between time and space is that you can't reuse time...
M. Furst
Re: write a program to simulate managing files on disk
I don't know java codes & how to start this program. do u have any idea about this. can you write a program.
If you can help me please!
please!
Re: write a program to simulate managing files on disk
Sounds to me that you will be repeating your Data structures and Algorithms class next Fall :wave:
Re: write a program to simulate managing files on disk
Quote:
Originally Posted by
Dhac
I don't know java codes & how to start this program.
You have to know at least basic Java to write a Java program. We're here to help Java programmers who get stuck, not to write programs for them.
Quote:
do u have any idea about this. can you write a program.
Yes, I have an idea - you need to learn some Java. And, yes, I can write a program - I have a full-time job writing programs.
Quote:
If you can help me please!
please!
Certainly, what is your question about Java?
The only way to learn a new programming language is by writing programs in it...
B. Kernighan & D. Ritchie