Final Flashcards

1
Q

Abstract Factory

A

A creational design pattern that creates an instance of several families of classes.

AnimalWorld Lab

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

Factory Method

A

A creational design pattern in which direct object construction is replaced with calls to special factory methods. The factory methods can now be overridden in a subclass and change the class of objects being created. This pattern creates an instance of several derived classes.

Document Lab (Resume and Report with different Pages)

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

Adapter

A

A structural design pattern that allows objects with incompatible interfaces to collaborate.

Square Peg Into Round Hole Lab

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

Composite

A

A structural design pattern that composes objects into tree structures to represent part-whole hierarchies. A composite lest clients treat individual object and compositions of objects uniformly.

Drawing Lab (Adding components to drawing)

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

Iterator

A

A behavioral design pattern that allows traversing elements of a collection without exposing its underlying representation (list, stack, tree, etc.).

Simple Collection Iterator Lab (Item<t>, Collection<t>, etc.)</t></t>

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

Observer

A

A behavioral design pattern that defines a subscription mechanism to notify multiple objects about any events that happen to the object they’re observing.

Stock Price Notification Lab

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

Row-Major Order Offset

A

offset = row * number of columns + column

E.g. row = 1, column = 1

offset = 1 * 3 + 1 = 3 + 1 = 4

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

Column-Major Order Offset

A

offset = column * number of rows + row

E.g. row = 1, column = 1

offset = 1 * 2 + 1 = 2 + 1 = 3

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

Graph Characteristics

A
  • Path - Can have unidirectional or bidirectional edges between nodes
  • Loops - can have loops, circuits, and self-loops
  • Root Node - No concept of a root node
  • Parent-Child - No parent-child relationship
  • Complexity - Loops increase the complexity
  • Traversal - Depth First Search (DFS) and Breadth First Search (BFS)
  • Graph Category - Cyclic or acyclic
  • Types - Directed and undirected
  • Applications - Coloring of maps, PERT charts, graph coloring, job scheduling, etc.
  • Number of Edges - Depends on the graph
  • Model - Network
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Tree Characteristics

A
  • Path - A special form of graph (i.e., minimally connected graph), having only one edge between any two vertices
  • Loops - No loops, no circuits, and no self-loops
  • Root Node - Exactly one root node and each child has only one parent
  • Parent-Child - Parent-child relationship
  • Complexity - Less complex
  • Traversal - Pre-order, in-order, and post-order
  • Graph Category - Directed Acyclic Graph (DAG)
  • Types - Binary, binary search, AVL, heaps, etc.
  • Applications - Sorting and searching applications
  • Number of Edges - N-1
  • Model - Hierarchical
How well did you know this?
1
Not at all
2
3
4
5
Perfectly