Computers in Engineering - 308-208 Lecture 20
Computers in Engineering - 308-208

# Lesson 20 - Learning Goals

## 20.4 Learn about the Big-O notation

Performance

Speed

Space

Accuracy

 O(n) 10 100 1E6 O(n log n) ~30 O(n2) 100 1E6 1E12

CLASSIFICATION OF ALGORITHMS

1. Numerical e.g. numerical integration
2. Non-Numerical e.g. sorting, searching

TYPES OF ALGORITHMS

1. Direct Computation (e.g. Income Tax)
2. Enumeration (e.g. Sequential Search)
3. Divide and Conquer (e.g. Binary Search)
4. Iteration (e.g. Series and Taylor Expansions)
5. Trial & Error (e.g. Newton Raphson)
6. Simulation (using Random Number Generators)

PROBLEM:

Given 9 cookies and 4 paper bags
Required to place an odd number of cookies in each bag.

Note: All cookies to be used (none eaten!)

1. Simulation

2. Enumeration - list all cases

3. Theoretical Approach

4. Creative Solution

Many more solutions…

ALGORITHM PROGRAMS AND EXAMPLES

There are several program examples for each type of algorithm discussed in lectures, including output and input files, in FORTRAN 90, PASCAL and C. These are found on:

The disk which accompanies the FORTRAN 90 book

On to the next lecture