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
Q

tuple types

A

similar to a record except that the elements are not named

26
Q

union type

A

variables may store different type values at different times during program execution

27
Q

pointer type

A

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
Q

reference type

A

refers to an object or value in memory.

29
Q

decimal type adv/disadv

A

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
Q

array design issues

A
  • 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
Q

column major order

A

the elements of an array that have the lower bound value stored in the last subscript are stored first

32
Q

row major order

A

elements of an array that have the lower bound value of stored in the first subscript are stored first

33
Q

fully qualified reference to record fields

A

all intermediate record names are named in the reference

34
Q

elliptical references to record fields

A

the field is named, but any of the enclosing record names can be omitted as long as the reference is unambiguous

35
Q

union design issues

A
  • should type checking be required?

- should unions be embedded in records?

36
Q

free unions

A

programmers are allowed complete freedom from type checking in their use

37
Q

discriminated union

A

each union construct is required to include a type indicator called a discriminant. a union with a discriminant is a discriminated union.

38
Q

design issues for pointers

A
  • 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
Q

dangling pointer

A

pointer that contains the address of a heap-dynamic variable that has been deallocated

40
Q

compatible type

A

is legal for the operator or is allowed under language rules to be implicitly converted by compiler generated code

41
Q

type error

A

application of an operator to an operand of an inappropriate type

42
Q

strongly typed

A

type errors are always detected

43
Q

type name equivalence

A

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
Q

structure type equivalence

A

two variables have the same type if their types have identical structures. more flexible but more difficult to implement

45
Q

nonconverting cast

A

the means of extracting the value of a variable of one type and using it as if it were of a different type