Section 10

Chapter 50 - Thinking logically, thinking concurrently

The structured approach

The structured programming approach aims to improve the clarity and maintainability of programs. Using structured programming techniques, only three basic programming structures are used:

Tools for designing algorithms

Two methods which are commonly used for designing algorithms are flow diagrams and pseudocode

A good strategy to test your algorithm is to create a trace table and follow it manually

Thinking concurrently

Concurrent processing takes place when several processes are running, with each in turn being given a slice of processor time. This gives the appearance that several tasks are being performed simultaneously, even though only 1 processor is being used.

Benefits and trade-offs of concurrent processing

Concurrent processing has benefits in many situations eg:

Chapter 51 - Problem recognition

Computable problems

A problem is computable if there is an algorithm that can solve every instance of it in a finite number of steps.

Methods of problem solving

There are many methods of problem solving, including:

  1. enumeration
  2. simulation
  3. theoretical approach
  4. creative solution

Enumearation

Uses the method of exhaustive search - trying all possible solutions until the correct one is found

Simulation

Simulation is the process of designing a model of a real system in order to understand its behaviour

Strategies for problem solving

Three main strategies for problem solving are Divide and conquer (reducing the size of the problem using binary search), Problem abstraction (removing details until the problem is reduced to one that was alreasdy solved before, eg graphs) and Automation (using programs with minimal human input)

Chapter 51 - Thinking procedurally

Backtracking

In some problems, in order to find a solution you have to make a series of decisions, but there may be cases for which:

Backtracking is a metodical way of trying out different sequences until you find one that leads to a solution. For example, solving a maze is a typical problem of that kind, using a depth-first traversal of a graph

Data mining

Data mining is the process if digging through big data sets to discover hidden connections and predict future trends