1/13
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Define UDT [3]
to create a new data type
to allow construction of data types not available in a programming language
constructed by the programmer
Explain Composite data types [3]
collection of data that consists of elements of the same or different data types grouped under a singular identifier
can be user-defined or primitive
includes records, sets, class/object
Explain non-composite data types and give the 2 types [4]
can be defined w/out referencing another data type
contains only one data type in their definition (can only hold one kind of data)
can be user-defined or a primitive data type
enumerated data types and pointer data types
Explain enumerated data types and give an example
has an ordered list of possible values
TYPE Tratings = (worst, bad, ok, good, great)
DECLARE RatingOne, RatingTwo: Tratings
RatingOne ← worst
RatingTwo ← RatingOne + 1
Explain pointer data types and give an example [4]
used to reference a memory location
stores addresses/ memory locations
indicates the type of data stored in the memory location
TYPE Tratingpointer = ^Tratings
DECLARE ratingpointer = Tratingpointer
ratingpointer ← ^RatingOne
State the 3 file organisation methods
Serial Files, Sequential Files, Random Filesand Indexed Files.
Explain serial files [3]
records are stored and accessed one after another
new records are added in the next available space — records are appended to file
when searching — every record needs to be checked until the record is found or all has been checked
Explain sequential files [5]
files are stored and addressed one after another
a new version of the file has to be created to update it
files are stored with ordered records — records are stored in order of the key field
new records are inserted in the correct position
when searching — the key field is compared and every record is checked until it is found, or the key field of a current record is greater than the one being searched for
Explain random fields [3]
records are stored in no particular order within the file (there is no sequencing)
there is a relationship between the record key and its location within the file — the location of the record is found using a hashing algorithm
updates to the file can be carried out directly
What are the 2 types of file accessing methods and which file organization applies to them
Sequential Access Process and Direct Access
Explain Sequential access process [3]
records are checked linearly until desired record is found/ EOF reached
starts searching for records one after the other from the start of file until record found/ EOF reached
most suitable when data is stored in a certain order based on a field — eg. bank stored data records in ascending order of account number
Explain Direct file accessing and explain respectively for the 2 types of files it applies to [5]
most suitable when a record is referenced by a unique address
allows a record to be found in a file w/out other records being read — records are found by using the key field of the target record (the record’s location is found using hashing algorithm)
sequential files
an index of all key fields is kept — the index is searched for the address of the file location where the target record is stored
random files
a hashing algorithm is used on the key field of the record to calculate address of the memory location where the target record is expected to be stored
linear probing or search overflow can be used to find a record if it is not a expected location
enumerated data type
self defined data types
pointer data type
used to find addresses of data