Organisation And Structure Of Data Flashcards
File Headers
Store data within a file, about the file.
.txt in windows has no info. Jpeg files describe how an image should be displayed
Fixed Length fields and records
2 points
Advantages & Disadvantages
Example
• same length
• some fields may be ‘padded out’ with spaces to make it the right length
Advantage
• Fast access because the location of each record can be quickly calculated.
• Quck to process all data
Disadvantage
•Usually larger files, need more storage space and are slower to transfer (load/save/transmit down network)
Eg
Information retrieval system
Train time-table program
Variable Length Files
1 point
Ad & Dis
Eg
• One or more fields can be differing length
• have terminator byte at end of each field and record
Ad
•Less storage space
• Faster to transmit /load/save
Dis
• Processing will be slower as each start and end point of each field needs to be calculated
Eg
•where download speed would be an issue
Sending list of customer details between 2 company offices
Serial File
Records stored one after another in no particular order
Sequential File
Records stored one after another and accessed in a key sequence order
Eg register ordered by surname
Indexed sequential
Records stored in key order
Index allows data to be accessed directly
Random Access
Hashing algorithm is used on a key field to calculate the location for the record in the file
Random access file
Consist of fixed length records ordered by their relative address
• can be read in sequential order
• accessed using the relative key. ( represents the location of the record relative to the start address)
• records inserted using relative key. Relative address calculated using relative key
Ad
• fastest access to records
Dis
•if intermediate records are missing, they will occupy space
Linear probing
For dealing with person with the same last name as exsisting record.
Next available space is used to store the record of person with the same last name
Daisy Chaining
Put record in same memory loaction with a pointer that points to the next person
Good hashing algorithm
- produces unique values
- wide spread of values
- fast calculation
- collisions
How hashing algorithm deletes records
Logically not physically
Pointers the point to the part of the disk are removed.
how hashing algorithm updates records
Calculate location of Harry’s
overwrite file in situ