2.1 Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an algorithm?

A

A sequence of step-by-step instructions to solve a problem or carry out a task. Can be represented using a flowchart or pseudocode.

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

What is a program?

A

A sequence of instructions for a computer.

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

What is computational thinking?

A

Solving problems logically, in a way that can be understood by humans and computers.

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

What is abstraction?

A

The removal of unwanted or unnecessary information from a task or problem in order to focus on the important and relevant information.

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 larger problem down into smaller tasks into smaller tasks that are easier to understand and solve.

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

What is sequence?

A

Carrying out tasks in a step-by-step series

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

What is iteration?

A

Repeating a task until a certain condition is met

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

What is selection?

A

A decision that needs to be made before the next step can be carried out.

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

What is a binary search?

A

Compares the required item to middle of the list, discards the irrelevant half of the list, repeats until the required item is found or the list has been fully checked.

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

Advantages and Disadvantages of binary search

A

+ Fast/efficient

  • Only works in an ordered list
  • Only works with numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a linear search?

A

compares each value in a list, one at a time, to a required value until a match is made.

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

Advantages and Disadvantages of linear search

A

+ Works with an unordered list

- Slower/less efficient than other searching algorithms

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

What is a bubble sort?

A

Repeatedly compares adjacent pairs of values in a list and swaps until all items are in order.

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

Advantages and Disadvantages of bubble sort

A

+ Simple algorithm and can be easily implemented on a computer
+ Doesn’t use much memory
- Doesn’t cope well with large lists
- Slower/less efficient than merge sort

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

What is a merge sort?

A

Data is repeatedly split into halves until single items remain, and is then reassembled in order.

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

Advantages and Disadvantages of merge sort

A

+ Quick/efficient

  • It’s slower on algorithms for small lists
  • Uses more memory than other sorting algorithms
17
Q

What is an insertion sort?

A

Sorts data one element at a time. The algorithm takes one data from the list and places it in the correct location in the list. This process o=is repeated until there are no more unsorted items in the list.

18
Q

Advantages and Disadvantages of insertion sort

A

+ Doesn’t use much memory

- Doesn’t cope well with large lists

19
Q

Pseudocode

A

A shared programming language using simple English terms to plan programs

20
Q

Flowcharts

A

Visualises an algorithm and shows clearly the flow of information

21
Q

Advantages of flowcharts

A
  • It is easy to see how a program flows. For example, where does following one path as opposed to another take the program?
  • Flow diagrams follow an international standard - it’s easy for any flow diagram user to pick up a diagram and understand it.
22
Q

Disadvantages of flowcharts

A
  • with a large program, the diagrams can become huge in size and unwieldy to follow
  • any changes to the design may mean a lot of the diagram has to be redrawn