Unit 2 - From Problems to Programs Flashcards

1
Q

When turning a computational problem into a program, what do we transform the computation problem into?

A

Algorithms and abstract data types.

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

When turning a computational problem into a program, what do we implement algorithms and abstract data types in?

A

A program.

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

When turning a computational problem into a program, what does the machine express?

A

Algorithms and abstract data types.

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

When turning a computational problem into a program, what do algorithms and abstract data types solve?

A

A computational problem.

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

When moving from a computational problem through to an algorithm, what do we create?

A

A set of abstractions.

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

In computer science, what is an abstraction?

A

A simplification, a model of some problem or object from which all but the relevant details have been eliminated.

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

What three constructs form an algorithm?

A

Sequence, iteration and selection.

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

What is a sequence?

A

A list of one or more instructions executed in order.

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

What is iteration?

A

Repeating a sequence of instructions over and over.

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

What is selection?

A

Evaluation of an expression to branch into executing one sequence or another.

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

What is the result of implementing an abstract data type?

A

A data structure.

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

How is an abstract data type implemented in a programming language?

A

As a data type or as a custom class.

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

What is meant by a linear data structure?

A

Items persist in the same position, relative to the other elements. A linear data structure has two ends - a top and a base.

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

Is a stack a FIFO or a LIFO data structure?

A

A stack is a LIFO data structure. Items added to a stack last come out first.

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

What is the meaning of the formal logic connective ∧?

A

This is a conjunction, which means ‘and’.

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

What is the meaning of the formal logic connective ∨?

A

This is a disjunction, which means ‘or’.

17
Q

What is the meaning of the formal logic connective ¬?

A

This is a negation, which means ‘not’.

18
Q

What is the meaning of the formal logic connective →?

A

This is an implication, which means ‘if … then’.

19
Q

What is meant by the term inertial convention?

A

Aspects of an abstract data type’s state not referred to in the postcondition are unaffected by the operation.

20
Q

What is meant by the term invariant?

A

An invariant of an abstract data type is a condition that must apply to every data structure that implements the abstract data type, throughout its lifetime.

21
Q

How is a function defined within mathematics?

A

As a relationship between a set of possible inputs (the domain) and a set of possible outputs (the range).