CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2009
    Posts
    2

    Unhappy 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>
    Last edited by Dhac; April 5th, 2009 at 03:53 AM.

  2. #2
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    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
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  3. #3
    Join Date
    Apr 2009
    Posts
    2

    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!

  4. #4
    Join Date
    Feb 2008
    Posts
    966

    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

  5. #5
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: write a program to simulate managing files on disk

    Quote Originally Posted by Dhac View Post
    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.

    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.

    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
    Please use &#91;CODE]...your code here...&#91;/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured