Week 1 Flashcards

1
Q

What are the two goals of computer design?

A
  1. To design an algorithm that is easy to understand, code, and debug. (primarily software engineering)
  2. To design an algorithm that makes efficient use of the computer’s resources.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a data structure?

A

Any data representation and its
associated operations. (Generally)

Or

An organization or structuring for a collection of data
items. (commonly)

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

What is The Cost of a solution?

A

The amount of resources that the solution consumes. Most often, cost is measured
in terms of one key resource such as time, with the implied assumption that the
solution meets the other resource constraints

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

What are the three steps to follow when selecting a data structure to solve a problem?

A
  1. Analyze your problem to determine the basic operations that must be supported. Examples of basic operations include inserting a data item into the
    data structure, deleting a data item from the data structure, and finding a
    specified data item.
  2. Quantify the resource constraints for each operation.
  3. Select the data structure that best meets these requirements.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the Three questions you should ask yourself whenever choosing a data structure?

A

Are all data items inserted into the data structure at the beginning, or are
insertions interspersed with other operations? Static applications (where the
data are loaded at the beginning and never change) typically require only
simpler data structures to get an efficient implementation than do dynamic
applications.

• Can data items be deleted? If so, this will probably make the implementation
more complicated.

• Are all data items processed in some well-defined order, or is search for specific data items allowed? “Random access” search generally requires more
complex data structures.

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

What is an exact match query?

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

Why is the Hash table appropriate for a banking system?

A

They can allow for extremely fast exact-match search. A record can be modified
quickly when the modification does not affect its space requirements. They also support efficient insertion of new records. While deletions can
also be supported efficiently, too many deletions lead to some degradation
in performance for the remaining operations. They can be reorganized periodically to restore the system to peak efficiency. Such
reorganization can occur offline so as not to affect ATM transactions.

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