Data Representation P3 Flashcards

1
Q

What is a user-defined data type?

A

A data type constructed by the programmer using primitive data types.

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

Why are user-defined data types important?

A

They improve code organization and reusability.

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

What are examples of user-defined data types?

A

Record

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

What is a composite user-defined data type?

A

A user-defined type that references at least one other type.

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

What is a record in programming?

A

A collection of related items which may or may not have different data types.

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

Give an example of a record definition.

A

TYPE TBook; DECLARE Name: STRING; DECLARE Isbn: INTEGER; ENDTYPE.

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

What is a set in programming?

A

A data structure that stores a finite number of unique items in no specific order.

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

Give an example of a set declaration.

A

TYPE Numbers = SET OF INTEGERS; DEFINE EvenNumbers (2

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

What is a class in OOP?

A

A template for creating objects with properties and methods.

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

What is an object in OOP?

A

An instance of a class.

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

What is inheritance in OOP?

A

When a class (subclass) derives from another class (superclass).

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

What is a non-composite user-defined data type?

A

A data type defined without referencing another type.

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

What is an enumerated data type?

A

A user-defined type with an ordered list of all possible values.

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

Give an example of an enumerated type.

A

TYPE Days: (Sunday

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

What is a pointer data type?

A

A type that stores the memory address of another variable.

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

Give an example of a pointer type declaration.

A

TYPE PIntPointer: ^INTEGER; DECLARE MyPointer: PIntPointer.

17
Q

What are the three file organizations?

18
Q

What is serial file organization?

A

Records are stored one after another in chronological order.

19
Q

What is sequential file organization?

A

Records are stored in key field order and a new version must be created to update.

20
Q

What is random file organization?

A

Records stored at computed addresses using hashing.

21
Q

What is a collision in random file organization?

A

When two records hash to the same address.

22
Q

How are collisions resolved in random access?

A

By searching overflow area linearly for the next empty spot.

23
Q

What is serial file access?

A

Reading records one by one in the order they are stored.

24
Q

What is direct/random file access?

A

Accessing records directly using key field/index or hash.

25
How is data accessed in sequential files?
Using indexes of key fields.
26
How is data accessed in random files?
Using a hash algorithm.