1st 10 Flashcards

1
Q

capture reusable pieces of design wisdom.

A

Design patterns

Goals:
Quickly communicate design wisdom to new designers
Give a shared vocabulary to designers

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

Notation OF LIFO
Insert:
Remove:
The accessible element is called BLANK

A

PUSH
POP
TOP.

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

Restricted form of list: Insert and remove only at front of list.

A

LIFO: Last In, First Out.

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

Restricted form of list: Insert at one end, remove from the other.

A

FIFO: First in, First Out

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

Notation OF FIFO
Insert:
Delete:
First element:
Last element:

A

Enqueue
Dequeue
Front
Rear

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

Often want to insert records, delete records, search for records.

A

Dictionary

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

Required concepts FOR DICTIONARY
Search key:
Key comparison
Equality:
Relative order:

A

Describe what we are looking for
Sequential search
sorting

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

Problem: How do we extract the key from a record?

Can’t just compare records to each other. Need to extract the key.
How? Could have an explicit key field? No. Explicit key method? No. Records can have multiple keys.
Could the key method be type-sensitive? No, multiple fields in the record can have the same type.

There is a fundamental problem: They key is not a property of the record, it is a property of the context in which the record is being used.

A

Can’t just compare records to each other. Need to extract the key.
How? Could have an explicit key field? No. Explicit key method? No. Records can have multiple keys.
Could the key method be type-sensitive? No, multiple fields in the record can have the same type.

There is a fundamental problem: They key is not a property of the record, it is a property of the context in which the record is being used.

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

Problem: How do we extract the key from a record?

A

We will explicitly store the key with the record.

NOTE: Fundamentally, the key is not a property of the record, but of the context.

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

SORTED VS UNSORTED LIST

If list were blank it Could use binary search to speed search
Would need to insert in order, WHICH would is not time efficient thus slowing insert

Which is better?
If lots of searches, blank list is good
If inserts are as likely as searches, then blank blank

A

sorted
sorting is no benefit.

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