Thinking Logically Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What makes a good algorithm?

A

Clear steps that produce the correct output for any set of valid inputs.
Should allow for invalid inputs.
Must always terminate at some point.
Should execute efficiently, in as few steps as possible.
Designed so others can understand and modify it.

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

What are 3 tools for designing algorithms?

A

Hierarchy charts: useful for identifying the major task and breaking down into subtasks
Flowcharts: useful for getting down initial ideas for individual subroutines
Pseudocode: will translate easily into program code

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

What are decision points (diamonds in flowcharts)?

A

The parts of an algorithm that can change the flow/outcome of a solution

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

What are examples of decision points?

A

IF and CASE statements.
<, >, ==, AND, OR, NOT

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

What is hand-tracing algorithms useful for?

A

Figuring out how an algorithm works and why it isn’t working properly

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

What is a trace table used for?

A

To write down the contents of each variable as it changes during execution

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

What is program flow?

A

The order in which individual statements, instructions or function calls of an imperative program are executed or evaluated

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

When identifying where a decision point is, what else do you need to explain?

A

Why it is there

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