Algorithms Flashcards

1
Q

Name 3 characteristics of an Algorithm

A
  1. Unambiguous
  2. Sequence of steps
  3. Provides a solution to a problem
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does an OVAL indicate in flowcharts?

A

start/end of an algorithm

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

What does a ROUNDED RECTANGLE indicate in flowcharts?

A

indicates a process to be carried out

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

What does a DIAMOND indicate in flowcharts?

A

indicates a decision to be made

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

What does a PARALLELOGRAM indicate in flowcharts?

A

input/output

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

What does an ARROW indicate in flowcharts?

A

displays the logical flow of the algorithm

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

What is a variable?

A

A variable holds a value that can be changed or used throughout the program

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

Give 3 examples of a date type

A

1) Integer
2) String
3) Boolean

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

What is a boolean?

A

a binary variable that can have one of two possible values, 0 (false) or 1 (true).

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

What is a constant?

A

A constant is always constant- it stays the same.

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

What is bubble sort?

A

The bubble sort algorithm starts at one end of the list and compares pairs of data items. If they are in the wrong order, they are swapped. The comparison of pairs continues to the end of the list.

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

What are the 4 steps of bubble sorting (ascending order)?

A
  1. Start at the beginning of the list
  2. compare the values in position 1 and position 2. If they are not in ascending order, swap them
  3. compare values in position 2 and 3 and swap if necessary
  4. Continue to the end of the list
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Merge Sort?

A

Merge sort is a sorting algorithm that divides a list into two smaller lists and then divides these until the size of the list is one.

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

define recursion

A

a process that is repeated

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

define brute force

A

an algorithm design that does not include any techniques to improve performance, but instead relies on computing power to try all possibilities until the solution to a problem is found

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

give an example of a brute force algorithm

A

bubble sort

17
Q

define ‘divide and conquer’

A

an algorithm design that works by dividing a problem into small sub problems, until they are easy to solve.The solutions to these are then combined to give a solution to the complete problem.

18
Q

What are the 5 steps of binary search?

A
  1. Select the median item of the list
  2. Stop if the median item is equal to the search item
  3. If the median is too high then repeat 1 and 2 with the sublist to the left
  4. If the median is two low then repeat 1 and 2 with the sublist to the right
  5. Repeat steps 3 and 4 until the item has been found
19
Q

What is computational thinking?

A

the thought processes involved in formulating problems and their solutions so that the solutions are represented in a form that can be effectively carried out by a computer.

20
Q

What are the 3 skills of computational thinking?

A
  • algorithm design
  • decomposition
  • abstraction
21
Q

what is decomposition?

A

breaking a problem down into smaller, more manageable parts, which are easier to solve

22
Q

what is abstraction?

A

the process of removing or hiding unnecessary detail so that only the important points remain.

23
Q

Define subprograms

A

a self contained module of code that preforms a specific task. It can be ‘called’ by the main program when it is needed.