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.
List and describe the 5 common data types
Integer- A whole number such as: 3, 45, -453
Float/Real- A number with a fractional part such as: 34.456, -9.2, 10.4, Pi(3.14159265…)
Character- A single character, where a character can be any letter, digit, punctuation mark or symbol that can be typed.
Describe how variable declaration is used in programs
In some programming languuages variables are decleared at the star of a progrtam so that when the program runs, the appropriate amount of memory can be reserved to store the data
Describe how constant declaration is used in programs
In some programs, there are certain values that can remain the same while the program runs. Constants are declared at the start of a program and can then be referred to as needed in the code
Describe how assignment is used in programs
In most programing languages, values are assigned to variables using an ‘=’ sign.
In pseudocode, we will use the ‘<==’ symbol to mean assignment
Describe how iteration is used in programs
There are two basic iteration constructs:
For Loop- allows you to exercute a group of steps a specific number of times.
While Loop- allows you to exercute a group of steps until a specific condition is met or not met.
Describe how subroutines are used in programs
A subroutine is a named, self-contained section of code that performs a specific task. It may reurn one or more valuses but doesn’t have to.
Understand what a pixel is
A pixel is a single point in an image, which can have its colour set independently
Be able to describe how pixels relate to an image
The more pixels you have the more detail you image has
Be able to describe the way images are displayed
Images are displayed by individual pixels turning on or off, turning on with different colours makes the image colourful.