Unit 2 - From Problems to Programs Flashcards
When turning a computational problem into a program, what do we transform the computation problem into?
Algorithms and abstract data types.
When turning a computational problem into a program, what do we implement algorithms and abstract data types in?
A program.
When turning a computational problem into a program, what does the machine express?
Algorithms and abstract data types.
When turning a computational problem into a program, what do algorithms and abstract data types solve?
A computational problem.
When moving from a computational problem through to an algorithm, what do we create?
A set of abstractions.
In computer science, what is an abstraction?
A simplification, a model of some problem or object from which all but the relevant details have been eliminated.
What three constructs form an algorithm?
Sequence, iteration and selection.
What is a sequence?
A list of one or more instructions executed in order.
What is iteration?
Repeating a sequence of instructions over and over.
What is selection?
Evaluation of an expression to branch into executing one sequence or another.
What is the result of implementing an abstract data type?
A data structure.
How is an abstract data type implemented in a programming language?
As a data type or as a custom class.
What is meant by a linear data structure?
Items persist in the same position, relative to the other elements. A linear data structure has two ends - a top and a base.
Is a stack a FIFO or a LIFO data structure?
A stack is a LIFO data structure. Items added to a stack last come out first.
What is the meaning of the formal logic connective ∧?
This is a conjunction, which means ‘and’.