Paper 1 Flashcards
1
Q
What is an algorithm?
A
- A sequence of steps / instructions which are followed to complete a specific task
2
Q
What is the point of pseudocode?
A
- Relaxed version of coding so that anyone can understand it
3
Q
Flowchart block shapes
A
- Oval = start / stop
- Rectangle = process
- Parallelogram = input / output
- Diamond = choice
4
Q
What is abstraction?
A
- The process of removing unnecessary detail from a problem
5
Q
What is decomposition?
A
- The process of breaking down a problem into smaller and more manageable chunks
6
Q
Explain linear search
A
- Compares each item in the list with the target item until it is found
- No need for the list to be ordered
- Simple and easy to code
- Very inefficient
7
Q
Explain binary search
A
- Compares middle item in list with target item and discards the half that it cannot be in
- Repeats finding middle item until target is found
- List must be ordered
- More complex and harder to code
- Much more effecient, especially for bigger lists
8
Q
Explain bubble sort
A
- Go in order of the list, comparing two adjacent items and putting them in the correct order
- Repeats until list is sorted
- Easy to code
- Not good for larger lists
9
Q
Explain merge sort
A
- Continously divides list until each list only has 1 item
- Combines two lists at a time, making sure that they are in order
- Repeats until whole list has been recombined and is in order
- More efficient
- Uses more memory
10
Q
What is the difference between / , DIV , MOD
A
- / = simple divide
- DIV = divide but answer is given as a whole number (no remainder / decimal)
- MOD = divide and only the remainder is returned
11
Q
What is a variable?
A
- An indentifier that holds a value that can be changed
12
Q
What are the 3 fundemental programming constructs?
A
- Sequence
- Selection
- Iteration
13
Q
Pros of using subroutines
A
- Can be reused
- Code doesn’t need to be rewritten so number of errors is decreased
- Less overall code so algorithm is more efficient
14
Q
Syntax error vs logic error
A
- Syntax error is a error in the code
- Logic error is when the code doesn’t work as expected
15
Q
Function vs procedure
A
- Function returns a value
- Procedure doesn’t