Paper 2 - Algorithms Flashcards

1
Q

Decomposition

A

Breaking down a complex problem into smaller problems and solving each individually

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

Abstraction

A

Picking out important parts of the problem and ignoring insignificant details

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

Algorithmic Thinking

A

Making logical steps towards a solution.

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

Sub Routine

A

sub programs referenced in a flow chart.

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

Bubble Sort Algorithm - What is it?

A

Swaps order of items if they’re in the wrong order.

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

Bubble Sort Algorithm - Pros and cons?

A

Pros: Simple, efficient to see if a list is in order and doesn’t use much energy
Cons: Inefficient way to sort a list, can’t cope with a very large list

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

Linear search: What is it?

A

Checks each item of a list to see if it’s the correct one

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

Linear Search: Pros and cons?

A

Simple and not as efficient as binary search. Used for smaller lists. Can be used on any type of list.

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

Binary Search: What is it?

A

Finds middle item in list, if the item i not what you’re looking for you compare it with the desired variable and discern if it is after or before in the list. Then you get rid of half the list and compare the desired variable with the middle item; Continue this until you find the desired item.

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

Merge Sort: What is it?

A

Splits the list into smaller sub lists, the second starting from the middle item; repeat this until all the lists contain one item and merge pairs of sub-lists with items sorted in order; repeat this until all the sub lists are together.

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

Merge Sort: Pros and Cons?

A

Pros: more efficient, quicker for large lists and has a consistent running time.

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

Insertion Sort: What is it?

A

It’s the simplest sorting algorithm; It compares each item to every other item in a list and insert them in the right place.

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

Insertion Sort: Pros and Cons?

A

Pros: Intuitive, easily coded, Good for small lists, doesn’t require much memory, quick if adding items to an ordered list, very good at checking if a list is already sorted.
Disadvantage: Doesn’t cope well with large lists.

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