ch13 Flashcards

1
Q

User-defined data type

A

a data type based on an existing data type or other data types that have been defined by a programmer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Describe the purpose of a user-defined data type

A

To create a new data type (from existing data types). and to allow data types not available in a programming language to be
constructed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Non-composite data type

A

a data type that does not reference any other data types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Enumerated data type

A

a non-composite data type defined by a given list of all possible values that has an implied order //// A (user-defined non-composite) data type with an ordered list of possible values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Pointer data type

A

a non-composite datatype that uses the memory address of where the data is stored //// A user-defined non-composite data type used to reference a memory location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Set

A

a given list of unordered elements that can use set theory
operations such as intersection and union

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain why the properties have been set to PRIVATE

A

To ensure that attributes can only be accessed by the class’s own methods
To enforce encapsulation// ensure theyre hidden

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Compare sequential and serial methods of file organisation

A
  • In both serial and sequential files records are stored one after the other
  • and need to be accessed one after the other
  • Serial files are stored in chronological order
  • Sequential files are stored with ordered records
  • and stored in the order of the key field
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

State the most suitable method of file access when a record is referenced by a unique address on a disk-type storage medium.

A

Direct (access)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

State the most suitable method of file access when a bank stores its data records in ascending order of account number.

A

Sequential (access)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe how records are organised and accessed in a sequential file

A

records are stored in a particular order
MP2 the order is determined based on the value in a key field
MP3 records are accessed one after the other
MP4 records can be found by searching from the beginning of the file, record by record,
MP5 … until the required record is found or key field value is exceeded.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Serial file organisation

A

a method of file organisation in which records of data are physically stored in a file, one after another, in the order they were added to the file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Sequential file organisation

A

a method of file organisation in which records of data are physically stored in a file, one after another, in a given order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Random file organisation

A

a method of file organisation in which records of data are physically stored in a file in any available position; the location
of any record in the file is found by using a hashing algorithm on the key field of a record.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Hashing algorithm (file access)

A

a mathematical formula used to perform a calculation on the key field of the record; the result of the calculation gives the address where the record should be found.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Sequential access

A

a method of file access in which records are searched one after another from the physical start of the file until the required record is found.

17
Q

Direct access

A

a method of file access in which
a record can be physically found in a file without physically reading other records

18
Q

how to deal with with key fields that have the same address

A
  • An open hash where the record is stored in the next free space.
  • A closed hash where an overflow area is set up and the record is stored in the next free space in the overflow area.
19
Q

Describe what happens, in relation to the storage or retrieval of a record in the file, when the calculated hash value is a duplicate of a previously calculated hash value for a different record key.

A

A collision occurs when the record key doesn’t match the stored record key
MP2 … this means the determined storage location has already been used
for another record.
If the record is to be stored
MP3 Search the file linearly
MP4 … to find the next available storage space (open hash)
MP5 Search the overflow area linearly
MP6 … to find next available storage space (closed hash)

20
Q

Explain what is meant by a user-defined composite data type. Include an example of another user-defined composite data type in your answer

A

A data type constructed by a programmer // not a primitive data type
 A data type that references at least one other data type…
the data types can be primitive, or user defined
Class / object / set