2.1 Algorithms Flashcards

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

What is computational thinking?

A

A problem-solving method using computer science techniques, where possible solutions are developed and presented 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
2
Q

What is decomposition?

A

Breaking down a complex problem or system into smaller parts that are more manageable and easier to understand.

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

What is abstraction?

A

The process of extracting or withdrawing something.

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

What is a syntax error?

A

error in the syntax of a sequence of characters that is intended to be written in a particular programming language

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

What is a logic error?

A

a mistake in a program’s source code that results in incorrect or unexpected behavior.

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

What is the rectangle in a flowchart?

A

process

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

How do you perform a Linear search?

A

Starting at the beginning of the data set, each item of data is examined until a match is made. Once the item is found, the search ends.

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

How do you perform a binary search?

A
  1. Start by setting the counter to the middle position in the list.
  2. If the value held there is a match, the search ends.
  3. If the value at the midpoint is less than the value to be found, the list is divided in half. The lower half of the list is ignored and the search keeps to the upper half of the list.
  4. Otherwise, if the value at the midpoint is greater than the value to be found, the upper half of the list is ignored and the search keeps to the lower half of the list.
  5. The search moves to the midpoint of the remaining items. Steps 2 through 4 continue until a match is made or there are no more items to be found.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How do you perform a bubble sort?

A
  1. Start at the beginning of the list.
  2. Compare the first value in the list with the next one up. If the first value is bigger, swap the positions of the two values.
  3. Move to the second value in the list. Again, compare this value with the next and swap if the value is bigger.
  4. Keep going until the there are no more items to compare.
  5. Go back to the start of the list.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you perform a merge sort?

A

The list is repeatedly divided into two until all the elements are separated individually. Pairs of elements are then compared, placed into order and combined. The process is then repeated until the list is recompiled as a whole.

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

How do you perform an insertion sort?

A

An insertion sort compares values in turn, starting with the second value in the list. If this value is greater than the value to the left of it, no changes are made. Otherwise this value is repeatedly moved left until it meets a value that is less than it. The sort process then starts again with the next value. This continues until the end of the list is reached.

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

What is the diamond in a flowchart?

A

Decision

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

What is the parallelogram in a flowchart?

A

input/ output

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

What is the arrow in a flowchart?

A

represents the flow

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