# Decision Maths 1 Revision

This is revision for the decision 1 maths syllabus.

- Created by: Billy Radford
- Created on: 25-05-10 09:37

First 394 words of the document:

Further Maths Revision.

Algorithms

Bubble Sort Used to order items into ascending or descending order.

To perform the bubble sort algorithm:

1. Start at the beginning of the list and compare the first and second term. If they are in

order leave them. If they are not in order swap them.

2. Then compare the second and third values and continue repeating until a pass is

completed without any swaps.

Quick Sort Used to order items in descending or ascending order.

To perform the quick sort algorithm:

1. Choose the item at the mid point for the pivot.

2. Write all items that are less than the pivot value before the pivot in a sub list, keeping

them in order.

3. Then write the pivot, which will now be in the correct place.

4. Then write all values greater than the pivot after the pivot keeping them in order as

they were in the list originally.

5. Then repeat these stages for each sub list until all values have been chosen as pivots.

Binary Search A binary search is used to find an item in an ordered list.

Binary search is a technique for locating a particular value in a sorted list by finding the

median value and comparing it to the target value.

To perform the binary search:

1. Select the middle value.

2. If the value you are looking for is the middle value stop.

3. If it is in the top half of the list discard the bottom half and the pivot.

4. If it is in the bottom half, discard the top half and pivot.

5. Then repeat steps for remaining items.

First fit bin packing algorithm.

To perform the first fit algorithm:

1. Take the items in the order given.

2. Place each item in the first available bin starting at bin 1.

First fit decreasing bin packing algorithm.

To perform the first fit decreasing algorithm:

1. Reorder the items into descending order.

2. Apply the first fit algorithm to the reordered list.

Full bin packing algorithm.

To perform the full bin algorithm:

1. Gather the items into full bins.

2. Then pack these full bins into the bins first.

3. Any remaining items apply the first fit algorithm.

## Comments