Algorithms Flashcards

1
Q

what is abstraction?

A

picking out the important details in a problem

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

what is decomposition?

A

breaking a larger problem down into smaller problems

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

what is algorithmic thinking?

A

the logical steps you take to get from a problem to a solution

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

what is pseudo code?

A

code which clearly shows the steps an algorithm takes without needing to follow syntax

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

In a flowchart, what does the oval shape represent?

A

start and stopping of the flowchart

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

In a flow chart, what does the paralelogram shape represent?

A

input/output

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

In a flow chart, what does the rectangle with vertical lines on the inside represent?

A

sub routine

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

In a flow chart, what does the rectangle represent?

A

processing/calculation

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

In a flow chart, what does the diamond represent?

A

decision

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

In a flow chart, what does the arrow represent?

A

connects the commands together

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

Which requires a list to be sorted, binary search or linear search?

A

binary search

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

How does a binary search work?

A

Finds the middle of the list, and decides if the item is higher or lower than the number being searched. If it is higher, then it will search in the higher part of the list or ‘right’, or if it is lower, then it will search the lower part of the list, or ‘left”. It repeats this until the time is found.

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

How does a linear search work?

A

Searches the item one by one in a list until found

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

How does an insertion sort work?

A

Splits the list into 2 parts, sorted and unsorted. Starting with the first item in the list, it moves on to the next item in the list, where it decides where it should go in the sorted list. It is not very efficient for larger lists.

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

How does a merge sort work?

A

Divides the list in 2 each step, before there is one list for each item. It then merges 2 lists together, sorting them in the process. It continues this until there is one big sorted list. More efficient on larger lists.

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

How does a bubble sort work?

A

Starts with the first item in the list, and compares it to the next. If the item is higher, it will swap them round and the item compares with the next item. If the item is lower, the higher item will be then compared with the next item along. It should end up with the highest item in the list at the end of the list, and that counts as a pass. It then repeats theses steps until the list is sorted

17
Q

what is a syntax error?

A

an error that is caused by incorrect spelling or grammar by the programmer

18
Q

what is a logical error?

A

an unexpected mathematic result that is caused by incorrectly using <, >, AND or OR