S1 Algorithms Flashcards

1
Q

Define decomposition

A

Breaking down a complex problem down into small problems and solving each one individually

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

Define abstraction

A

Picking out the important bits of information from the problem, ignoring the specific details that don’t matter

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

Define algorithmic thinking

A

A logical way of getting from the problem to the solution. If the steps you take to solve a problem following algorithm then the can be reused and adapted to solve similar problems in the future

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

What is pseudo code?

A

Not an actual programming language but follows a similar structure and reads like one. The idea is that pseudocode clearly shows an algorithms steps without worrying about syntax.

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

Features and benefits of pseudo code

A
  • Quick to write
  • Easily converted to any programming language
  • Code is valid as long as the person reading can follow and understand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In a flowchart what does this shape mean ⚪

A

Start/ stop

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

In a flowchart what does this shape mean /___/

A

Input/output

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

In a flowchart what does this shape mean ⬜

A

Processes

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

In a flowchart what does this shape mean 🔷

A

Decision

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

In a flowchart what does this shape mean 🇮🇪

A

Subroutine

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

What are the four steps of the binary search algorithm?

A

1) Find the middle term in the ordered list
2) If this is the item you’re looking for then stop the search
3) If not compare the item you’re looking for with the middle term. If it comes before the middle item, get rid of the second half. If it comes after the middle item, get rid of the first half.
4) You’ll be left with a list that is half the size. Repeat steps 1 - 3 until you have found the item

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

What are the four steps of the linear search?

A

1) Look at the first value in the unordered list
2) If this is the item you’re looking for then stop the search
3) If not then look at the next item in the list
4) Repeat steps 2 - 3 until you’ve found the item, or you have reached the end of the list

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

What are the differences between a linear and binary search?

A
  • linear is simpler but less effective (doesn’t matter though, if list is small)
  • linear can be used on any list (doesn’t need to be ordered)
  • For large ordered lists run time of binary search would be much faster.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the 5 steps of the bubble sort algorithm?

A

1) Look at the first 2 items in the list
2) If they’re in the right order, you don’t have to do anything. If they’re in the wrong order, swap them.

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