CSC 351 - Chapter 6 Flashcards

1
Q

data type

A

defines a collection of values and a set of predefined operations on those values.

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

user-defined types

A

improved readability by using meaningful names and allow changeability

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

abstract data type

A

the interface of a type is separated from the representation and set of operations on values of the type

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

descriptor

A

collection of the attributes of a variable

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

primitive data types

A

data types that are not defined in terms of other types

numeric types - floating point, integer, complex, decimal, boolean, character

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

character string type

A

values consist of sequences of characters. Character string constants are used to label output, and the input and output of all kinds are often done in terms of strings.

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

character string type design issues

A
  • should strings be a special kind of character array or a primitive type
  • should strings have static or dynamic length
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

string operations

A

assignment, catenation, substring reference, comparison and pattern matching

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

static length string

A

length is static and set when the string is created

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

limited dynamic length string

A

allow strings to have varying length up to a declared and fixed maximum set by the variables definition

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

dynamic length string

A

allow strings to have varying length with no maximum

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

ordinal type

A

the range of possible values can easily be associated with the set of positive integers

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

user-defined ordinal types

A
  • enumeration

- subrange

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

enumeration types

A

possible values are provided in the definition. they provide a way of defining and grouping collections of named constants. they can enhance readability and reliability.

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

subrange types

A

a contiguous subsequence of an ordinal type. can enhance readability and reliability

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

array types

A

homogeneous aggregate of data elements in which an individual element is identified by its position. the individual data elements are of the same type.

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

static array

A

subscript ranges are statically bound and storage allocation is done before run time. this is efficient but the storage size is fixed.

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

fixed stack-dynamic array

A

subscript ranges are statically bound and storage allocation is done during execution. this is space efficient

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

stack-dynamic array

A

both the subscript ranges and storage allocation are dynamically bound during execution. these are flexible but once subscript ranges are bound they are fixed

20
Q

fixed heap-dynamic array

A

subscript ranges and the storage binding are both fixed after storage is allocated. these are flexible, but the allocation time is longer because it is using the heap rather than the stack

21
Q

heap-dynamic array

A

binding of subscript ranges and storage allocation is dynamic and can change any number of times during the arrays lifetime. these are flexible but not time efficient

22
Q

slice

A

some substructure of an array

23
Q

associative array

A

unordered collection of data elements that are indexed by an equal number of values called keys (hashes, dictionaries, maps)

24
Q

record types

A

aggregate of data elements in which the individual elements are identified by names and accessed through offsets from the beginning of the structure

25
tuple types
similar to a record except that the elements are not named
26
union type
variables may store different type values at different times during program execution
27
pointer type
variables have a range of values that consist of memory addresses and a special value, nil. pointers provide indirect addressing and a way to manage dynamic storage
28
reference type
refers to an object or value in memory.
29
decimal type adv/disadv
adv: able to precisely store decimal values which cannot be done with floating-point. disadv: the range of values are restricted because no exponents are allowed
30
array design issues
- what types are legal for subscripts? - are subscripting expressions in element references range checked? - when are subscript ranges bound - when does array allocation take place - can arrays be initialized when they have their storage allocated - what kind of slices are allowed
31
column major order
the elements of an array that have the lower bound value stored in the last subscript are stored first
32
row major order
elements of an array that have the lower bound value of stored in the first subscript are stored first
33
fully qualified reference to record fields
all intermediate record names are named in the reference
34
elliptical references to record fields
the field is named, but any of the enclosing record names can be omitted as long as the reference is unambiguous
35
union design issues
- should type checking be required? | - should unions be embedded in records?
36
free unions
programmers are allowed complete freedom from type checking in their use
37
discriminated union
each union construct is required to include a type indicator called a discriminant. a union with a discriminant is a discriminated union.
38
design issues for pointers
- what is the scope and lifetime of a pointer variable? - what is the lifetime of a heap-dynamic variable? - are pointers used for dynamic storage management and/or indirect addressing
39
dangling pointer
pointer that contains the address of a heap-dynamic variable that has been deallocated
40
compatible type
is legal for the operator or is allowed under language rules to be implicitly converted by compiler generated code
41
type error
application of an operator to an operand of an inappropriate type
42
strongly typed
type errors are always detected
43
type name equivalence
two variables have the same type if they are defined in the same declaration or in declarations that use the same type name. easy to implement but more restrictive.
44
structure type equivalence
two variables have the same type if their types have identical structures. more flexible but more difficult to implement
45
nonconverting cast
the means of extracting the value of a variable of one type and using it as if it were of a different type