Data Structure (2130702)

BE | Semester-3   Winter-2017 | 11/14/2017

Q4) (b)

What is the difference between serial and sequential processing? How a record can be deleted in sequential file?

Serial File

  • This is the simplest type of file structure.
  • In a serial file structure, the records are stored one after the other without any logical order.
  • In case of new records need to be added to the file, they are appended to the end of the file.

Sequential File

  • A sequential file is a serial file that has been given a logical order. The order of records in a sequential file is usually by key field.

Deleting records from Sequential File

   open the file for input
   open a new file for output
   read a record from the file

   while there are more records to read
      if the record is the one to be deleted
         do nothing
      else
         write the record to the new file
      end if
      read another record from the file
   end while

   close the file
   close the new file