2.1 Algorithims Flashcards

1
Q

What is an algorithm?

A
  • Set of instructions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is decomposition?

A
  • Breaking up data
  • Smaller more manageable parts
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is abstraction?

A
  • Ignoring parts of data
  • Faster outcome
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does a rounded rectangle represent in flowcharts?

A
  • Start / Stop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does a rectangle represent in flowcharts?

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

What does a diamond represent in flowcharts?

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

What does a diamond represent in flowcharts?

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

What does a parallelogram represent in flowcharts?

A
  • Input / Output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does a rectangle with two lines inside represent?

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

What is a variable?

A
  • A location in memory
  • Can be changed while the program is running
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the steps for a bubble sort?

A
  • Start at the beginning of the values
  • Compare the first and second values : if not in order, swap
  • Continue through the list
  • Repeat through the list until in order
  • Do one last pass to ensure order
    ** One comparison is one pass
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the steps for merge sort?

A
  • Split all elements into individual lists
  • Compare the first elements of the lists
  • Place the smallest in a new list
  • Continue to compare first elements of the lists
  • Repeat until individual lists have merged
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the steps for an insertion sort?

A
  • The item is taken and placed in the correct position
  • Continue through
  • Repeat until sorted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When is a bubble sort the better choice?

A
  • Shorter list
  • Mostly in order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When is a insertion sort the better choice?

A
  • Mostly in order
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

When is a merge sort the better choice?

A
  • Longer list
  • Completely randomised
  • Reversed data set
17
Q

What is a linear search?

A
  • Go through every value one by one
18
Q

What is a binary search?

A
  • Isolate the right or left of the list depending on the value through the middle
  • Continue to narrow down