Year 10 - Paper 2 Flashcards

1
Q

Binary search

A

Has to have items in order. It finds the middle number, and compares it to the answer. If the middle is lower than the item, the first half of the list is removed. Repeated until found

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Sorting

A

When we arrange the list in a certain order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Bubble sort

A

Compares two items in a list, swaps them if needed, this needs to go through the list multiple times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Insertion sort

A

Puts items in correct place, based on already sorted items.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What’s abstraction?

A

Removing unnecessary detail and focusing on the important parts, this helps to simplify the problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s Decomposition?

A

Breaking a problem into a smaller problem, which makes it easier to solve

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What’s Algorithmic thinking?

A

The process of turning the solution of the problem into a set of clear instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are inputs?

A

Clear pieces of data we need to give the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are processes?

A

What the computer does with this data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are outputs?

A

What the computer returns to the user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are structure diagrams?

A

A graphical way of representing a problem, showing the different levels of detail. They often show the functions of a program with the sub-functions branching below them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What’s a logic error?

A

Does not prevent the program running, but it does not produce the expected output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What’s a syntax error?

A

An error that breaks the rules of the programming language, it will not run the program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are trace tables?

A

When we go through the code and record what values the variables take. We can also find the output. This is a good way of looking for logic errors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What’s searching?

A

When we look for a specific item in a list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Binary search only works with…

A

sorted lists

17
Q

How does binary search work?

A

Finds the middle number, compares that to the answer. If the middle is lower than the item, the first half of the list is removed. This is repeated until the item is found

18
Q

How does a linear search work?

A

Checks each item in turn to see if it is the correct one, starting from the beginning

19
Q

How does bubble sort work?

A

Compared 2 items in a list, starting from the beginning, and swaps them if needed. It then moves onto the next pair

20
Q

How does Merge sort work?

A

The list is repeatedly divided into two until all elements are separated individually. Pairs of elements are ten compared, placed into order and combined. This is repeated until the list is recompiled as a whole

21
Q

How does insertion sort work?

A

Puts items in the correct place, based on already sorted items. If the value it is looking at is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a value that is less than it. The sort process then starts again with the next value. This continues until the end of the list is reached.

22
Q

What’s a variable?

A

A location in memory that stores data, this data can be changed while the program is running

23
Q

What is a constant?

A

A location in memory and the value that does not change (while the program is running)

24
Q

For loops are…

A

count controlled

25
Q

While loops are

A

condition controlled

26
Q

What is casting?

A

When we convert to a different data type (e.g srt(), int())

27
Q

String manipulations - concatenation

A

When two or more strings are joined together. There are no commas in concatenation

28
Q

Case sensitive

A

When a user inputs something in e.g. upper case when it should be lower case, and a logic error occurs. To change to uppercase, we add .upper() to the end of a print statement and .lower() for lowercase. For only the first letter to be in caps, we use .capitalize(). e.g. print(x.lower())

29
Q

Slicing

A

When we slice parts of a string. To extract the first x characters in a string, we use .left(x) / extract the last x characters in a string we use .right(x)

30
Q

read, open, write and close files

A

read = variable.read() / open = variable = open(“filename.txt”, “r”) / write = variable.write(field1 +field2 + “\n”) / close = variable.close()

31
Q

What’s a local variable

A

Variables that only work in the subprogram and are not recognised by the rest of the main program

32
Q

What’s a global variable

A

recognised/available to the entire program, including subprograms

33
Q

Computational thinking

A

formulating a problem and expressing its solution in a way that a computer can carry out