Week 1 Flashcards
What are the two goals of computer design?
- To design an algorithm that is easy to understand, code, and debug. (primarily software engineering)
- To design an algorithm that makes efficient use of the computer’s resources.
What is a data structure?
Any data representation and its
associated operations. (Generally)
Or
An organization or structuring for a collection of data
items. (commonly)
What is The Cost of a solution?
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
What are the three steps to follow when selecting a data structure to solve a problem?
- 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. - Quantify the resource constraints for each operation.
- Select the data structure that best meets these requirements.
What are the Three questions you should ask yourself whenever choosing a data structure?
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.
What is an exact match query?
Why is the Hash table appropriate for a banking system?
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.