Chapter 50

Structured Programming

A structured programming approach should be used to improve the clarity and maintainability of programs. Only three basic structures are included in this technique:

  1. Sequence: one statement following another
  2. Selection: e.g. if [...] then [...] else [...], and switch case statements
  3. Iteration: e.g. while, do, and for loops

Some languages are block structured meaning they only allow the use of these three structures


Designing Algorithms

Flow diagrams or pseudocode can be used to design algorithms

A flowchart

An example of pseudocode

Ways of testing these algorithm designs include trace tables


Thinking concerrently

Concurrent processing is related to parallel proccesing, and the differences between the two are oft-debated. A distinction between the two is that parallel processing requires multiple processors while concurrent processing can be run on one processor.

Concurrent processing can increase the number of tasks completed in a given time by a processor and reduce time wasted waiting for user interaction however it can increase the amount of time it takes for some programmes to complete especially when there are many users. Parallel processing offeres many similar benefits like an increase in speed and the ability for a computer to run multiple programs at once, however, some tasks may run slower than if there was a single processor due to the extra effort that it takes to coordinate the processors

Chapter 51

Computable Problems

If an algorithm can solve every instace of a problem in a finite number of steps, that problem is said to be 'computable'. There are many ways to solve these problems, like:


Different Strategies

Top down design, or breaking a large task into smaller tasks, can be implemented in different ways.

Divide and conquer is a techinque that reduces the size of the problem with every iteration, an example of this is a binary search

Abtraction, as discussed in my earlier web page, is simplified way of representing a problem

Automation is a type of simulation where you run a model of a problem to get results that help you solve it

Chapter 52

Visualisation

Presenting a problem well can help in finding a solution. Humans often prefer looking at images to other methods of representing problems.


Backtracking

Somethimes when solving a problem you may have to make series of decisions, but it can often be confusing to determine which desicions to make. Backtracking is the process of trying different sequences until you find a solution.


Data Mining

This is the process of digging through data sets. 'Big data' is the term used for sets of data so large that they cannot be handled traditionally


Intractable problems

If an algorithm exists to solve a problem but it would take an unreasonable long amount of time to run, the problem is called 'Intractable'. These problems can sometimes just be solved by brute force, or trying out every possible solution.

A different option for solving these problems is to solve a simpler version which can help to inform on how to solve the main problem. Solving a problem in a way that is sufficient but not perfect is called a heuristic approach.


Performance modelling and pipelining

Perfomance modelling is when varying user and system loads are simulated to test a compter by mathmatical approximation.

Pipelining is splitting tasks into smaller parts with proccesing that overlaps

Note: I forgot to write this in word so I could measure the wordcount, it's definatly more than 400, sorry.