Paper 1 Flashcards

1
Q

What is an algorithm?

A
  • A sequence of steps / instructions which are followed to complete a specific task
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the point of pseudocode?

A
  • Relaxed version of coding so that anyone can understand it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Flowchart block shapes

A
  • Oval = start / stop
  • Rectangle = process
  • Parallelogram = input / output
  • Diamond = choice
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is abstraction?

A
  • The process of removing unnecessary detail from a problem
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is decomposition?

A
  • The process of breaking down a problem into smaller and more manageable chunks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a variable?

A
  • An indentifier that holds a value that can be changed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the 3 fundemental programming constructs?

A
  • Sequence
  • Selection
  • Iteration
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Function vs procedure

A
  • Function returns a value
  • Procedure doesn’t
How well did you know this?
1
Not at all
2
3
4
5
Perfectly