Problem Solving and Theory of Computation Flashcards

1
Q

Computational Thinking

A

The ability to think logically about a problem and apply techniques for solving it.

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

Methods of Problem Solving

A

Simulation
Enumeration – list all cases
Trial and error
Theoretical Approach
Creative solution

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

Simulation Problems

A

Simulation is the process of designing a model of a real system in order to understand the behaviour of the system, and to evaluate various strategies for its operation.
Simulation applications include:
Financial risk analysis
Amusement park rides
Population predictions
Managing inventory systems
Queueing problems

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

Strategies for Algorithm Design

A

Decrease and conquer.
This involves finding a solution to a sequence of smaller, related problems until the instance is small enough to be solved directly.
A good example of this is the binary search algorithm.

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

Structured Programming

A

Structured programming is a method of writing a computer program which uses:
Top-down analysis for problem-solving.
Modularization for program structure and organisation.
Structured code for the individual modules.

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

Sequence

A

A sequence consists of one or more statements following one after the other.

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

Selection

A

Selection is implemented using an IF…THEN…ELSE statement. Some languages also have a CASE statement.

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

Iteration

A

Iteration means repetition. Most high level languages have three iterative structures.

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

High Level Language Structures

A

Structured programming is only possible
because the structures are built in to programming languages like Python, Java, VB and C#. Early programming languages had no
iterative statements.

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

Top-Down Design Model

A

Structured programming uses a top-down design technique.
The program is divided into modules, which are called from the main program.
Any of the modules may be further broken down into smaller sub-tasks, with the smallest modules performing a single function.
A hierarchy chart may be used to show the overall program structure.

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

Hierachy Chart

A

Any module shown below another module is part of the module above.
Execution takes place from left to right, always at the lowest level component.
Selection and iteration are not shown in a hierarchy chart.

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

Benefits of Structured Programming

A

Programs are more easily and quickly written.
Large programs are broken down into subtasks that are easier to program and manage.
Each module can be individually tested.
Modules can be re-used several times in a program.
Frequently used modules can be saved in a library and used by other programs.
Several programmers can simultaneously work on different modules, shortening development time.
Programs are more reliable and have fewer errors.
It is easier to find errors in small self-contained modules.
Programs take less time to test and debug.
Programs are easier to maintain.
A well-organised, modular program is easier to follow.
It is easier to find which module needs to be changed.
Self-contained modules mean that the change should not affect the rest of the program.
New features can be added by adding new modules.

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

Good Programming Practice

A

Use meaningful names for variables and subroutines.
Add lots of comments to explain each module.
Each module should perform a single task.
Selection and iteration structures should have single entry and exit points.
Keep each module self-contained by passing parameters and using local variables in subroutines.

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

Modular Programming

A

Modular design and programming techniques are most useful for large, complex programs.

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

Properties of a Good Algorithm

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