Quiz
Ch 11
Este quiz tem tipos de pergunta que abrem no player de sempre.
Perguntas do quiz (13)
1 An [blank_start]abstraction[blank_end] is a view or representation of an entity
that includes only the most significant attributes.- Aabstraction
2The two types of abstraction are [blank_start]process[blank_end] abstraction and [blank_start]data[blank_end] abstraction.
- Aprocess
- Bdata
3Syntactically, ADT is an [blank_start]enclosure[blank_end] that includes only the
[blank_start]data representation[blank_end] of [blank_start]one[blank_end] specific data type and the
[blank_start]subprograms[blank_end] that provide the operations for that type.- Aenclosure
- Bdata representation
- Cone
- Dsubprograms
4An instance of an ADT is called an [blank_start]object[blank_end]
- Aobject
5An Abstract Data Type (ADT) is [blank_start]a user-defined[blank_end] data type
that satisfies the following two conditions:
1. The [blank_start]representation of objects[blank_end] of the type is [blank_start]hidden[blank_end] from
the program units that use these objects (i.e. client),
so the only operations possible on those objects are
provided [blank_start]in the type's definition[blank_end] -- [blank_start]Information hiding[blank_end]
2. The [blank_start]declarations[blank_end] of the type and the [blank_start]protocols[blank_end] of
the operations on objects of the type are contained
in [blank_start]a single syntactic unit[blank_end].- Aa user-defined
- Brepresentation of objects
- Chidden
- DInformation hiding
- Ein the type's definition
- Fdeclarations
- Gprotocols
- Ha single syntactic unit
6 Advantages of the 1st condition: [blank_start]information hiding[blank_end]
– [blank_start]Reliability:[blank_end] a client [blank_start]cannot manipulate[blank_end] the representation
of objects, so increase the integrity of such objects.
Objects [blank_start]can be only changed[blank_end] through the provided
operations.
– [blank_start]Reduces[blank_end] the range of code and variables of which the
programmer must be aware.
– Name conflicts are [blank_start]less[blank_end] likely.- Ainformation hiding
- BReliability:
- Ccannot manipulate
- Dcan be only changed
- EReduces
- Fless
7• Advantages of the 2nd condition: [blank_start]a single syntactic unit[blank_end]
– Provides a method of [blank_start]program organization[blank_end].
– Aids [blank_start]modifiability[blank_end] (everything associated with a data
structure is together).
– [blank_start]Separate compilation[blank_end].- Aa single syntactic unit
- Bprogram organization
- Cmodifiability
- DSeparate compilation
8A facility for defining ADTs in a language must provide:
• A [blank_start]syntactic unit[blank_end] in which to encapsulate the type definition.
• A [blank_start]method[blank_end] of making type names and subprogram headers visible to clients, while hiding actual definitions.
• Some [blank_start]primitive operations[blank_end] must be built into the language processor.
– Operations that [blank_start]apply to a broad range of ADT[blank_end]:
• e.g.) assignment and comparisons for equality and inequality
– Some operations [blank_start]are commonly needed[blank_end], but must be defined by [blank_start]the type designer[blank_end]
• e.g.) iterators, constructors, destructors- Asyntactic unit
- Bmethod
- Cprimitive operations
- Dapply to a broad range of ADT
- Eare commonly needed
- Fthe type designer
9Design Issues for ADT
• [blank_start]Encapsulate[blank_end] a single type, or something more?
• What types can be [blank_start]abstract[blank_end]?
• Can abstract types be [blank_start]parameterized[blank_end]?
• What [blank_start]access controls[blank_end] are provided?
• Is the specification of the type [blank_start]physically separate[blank_end] from its implementation?- AEncapsulate
- Babstract
- Cparameterized
- Daccess controls
- Ephysically separate
10Encapsulation original motivation:
• Two special needs for [blank_start]large[blank_end] programs:
1. Some means of [blank_start]organization[blank_end], other than simply division into subprograms.
2. Some means of [blank_start]partial compilation[blank_end] (compilation units that are smaller than the whole program)- Aorganization
- Blarge
- Cpartial compilation
11[blank_start]Encapsulations[blank_end] are a grouping of subprograms that are [blank_start]logically related[blank_end] into
a unit that can be separately compiled- AEncapsulations
- Blogically related
12C++ has two constructs that directly support ADT: [blank_start]class[blank_end] and [blank_start]struct[blank_end].
• In a class the default access modifier is [blank_start]private[blank_end].
• In a struct: the default access modifier is [blank_start]public[blank_end].- Aclass
- Bstruct
- Cprivate
- Dpublic
13Instances in C++ can be
- Astatic
- Bstack dynamic
- Cheap dynamic
- Dimplicit heap dynamic
Informações
- Descrição
- Quiz sobre Ch 11, criado por Nina Van Ess em 08-12-2023.
- Autor
- Nina Van Ess
- Idioma
- English
- Visualizações
- 1
- Histórico
- Criado em 8 dez 2023 · atualizado em 11 dez 2023
- Avaliação
- Ainda sem avaliações Avalie este quiz