Paper 1 Flashcards
Explain the term algorithm
`An algorithm is a seirs of steps that can be folloed to complete a task.
Understand a computer program is…
an implementation of an algorithm.
Explain the terms:
1) Abstraction
2) Decomposition
1) Abstraction involves removing unnecessary details ffrom a problem in order ro solve it.
2) Decomposition involves the breaking down of a problem into smaller, simpler steps or stages.
Be able to solve problems using pseudocode or flowcharts
Give an example.
Page 6 - 12 of the Tecbook in classroom
Identify simple inputs, processes and outputs in algorithms
Input data - for example, ask the user a question or
collect a value from a sensor.
Process data - for example, add two values together or make a decision when a value reaches a certain amount.
Output data - display some results or play a sound.
Define the purpose of simple algorithms
Simple algorithms process inputted data and give an output.
Recognise that more than one algorithm can solve the same problem
Give examples
Compare algorithms based on their efficiency
Give examples
Explain how the linear search algorithm works
A linear search is when you search every single item in the list for a certain number. If you need the biggest or smallest numbers you need to search the whole list, but if you are looking for a certain number you only need to search the list until you find it.
Explain how the binary search algorithm works
A binary search is when you search for a certain number in a sorted list by halfing the list discarding the half too big or too small until you are left with the number you want to find,
Compare and contrast linear and binary algorithms
Linear searches can be performed in any list of numbers.
Binary searches can oly be performed on a sorted list.
Linear searches may work well on smaller list, but Binary searches are much quicker in big lists (most of the time)
Explain how the merge sort algorithm works
This is a two stage sort.
The first stage devides the list (by 2) forming a sublist, until each sublist is of one lenghth long.
The second stage repeatedly merges the sublist to produce a new sorted sublist until there is only one sublist remaining.Merging the final two sublists results in the sorted list.
Explain how the bubble sort algorithm works
A bubble sort works by reoeatedly going through the list to be sorted comparing each pair of adjacent elements. If the elements are in the wrong order they are swapped. This is doen in passes until the whole list is sorted but the computer must check this by compleating a final pass.
Compare and contrast the bubble and merge sort algorithms
The bubble sort algorithm is very slow and inefficient for sorting more than a very few items, wheras the merge sort is relitivly qucker.
On the other hand, the bubble sort algorithm is much simpler and easyer to understand for the coder than the merge sort algoritm.
Explain the concept of a data type
Any data that a program uses must be stored in memory locations, each given its own identifier while the program is running. Data types are diffent types of data and are catogries we sort data into.