Computing Test 3

  • Algorithms

  • Types of searches

  • Types of sorts

  • Flowcharts

Algorithms

A step by step set of instructions telling a code, computer or anything which can follow instructions to do somenthing. The oldest algorithm is Euclit’s algorithm. It uses the largest common divisor. Specific Task

Flowcharts

Flowcharts are visual representations of algorithms. They have yes and no answers which create the algorithm.

Oval = Start or end of the process

Rectangle = Notes the process for an operation or step

Arrow = Indicates the flow between steps

Diamond = Signifies a point requiring a yes or a no

Paralellogram = Used for input or output operations

Sorts

There are 2 types of sort:

  • Bubble sort

  • Merge sort

In a bubble sort, the algorithm compares each number in pairs from the start of the list and then works its’ way up swapping until the list stops. It then completes several passes to go all the way through and sort the list completely.

In a merge sort, it uses a technique called divide and conquer. The system will forst split the whole list in half and then continue doing it until there are only pairs. It will then order the pairs and compare with other pairs to complete a series of swaps until the list is put back together in order.

Searches

There are 2 types of searches:

  • Linear search

  • Binary search

In a linear search, the system will check each item individually until the list ends or the match is made.

In a binary search, the system must run on an ordered list. Firstly, it halves the list and checks whether the item is smaller or larger, it will then eliminate the numbers that don’t apply. Then it does the same, always halving it and checking it until the item required is found. If it isn’t in the list, the system will output a message saying that the item wasn’t found.