Section 1 - Fundamentals Of Algorithms Flashcards

1
Q

What is an algorithm?

A

An algorithm is a series of steps that can be followed to complete a task.

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

What is decomposition?

A

Decomposition involved breaking down a problem into smaller, simpler steps.

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

What is abstraction?

A

Abstraction involves removing unnecessary details from a problem in order to solve it.

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

What are flowcharts?

A

Flowcharts are diagrams which use certain symbols to show the flow of data

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

What does the oval represent in a flowchart?

A

The START and END

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

What does the quadrilateral represent in a flowchart?

A

It is a process box. (E.g 1 + 1)

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

What does the parallelogram represent in a flowchart?

A

This is an input and output box

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

What does the diamond represent in a flowchart?

A

This is a decision box that can only accept yes or no answers

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

What is pseudocode?

A

Pseudocode is used to write an algorithm in programming-style constructs but it is not in an actual programming language

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

What are the 3 constructs used to write algorithms?

A

Sequence, selection and iteration

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

What is selection?

A

If, elif and else

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

What is sequence?

A

Sequence is just the order code goes in.

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

What is iteration?

A

For, while and repeat

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

What are the 2 common search routines?

A

Linear and binary searches

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

What is a linear search?

A

When data is unsorted, the only sensible option when searching for a particular item is to start at the beginning and look at every item until you find the one you want

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

What is a binary search?

A

If the list is sorted, it repeatedly divides in half the data, that could contain the required data item

17
Q

What are the 2 kinds of sorting algorithm?

A

Bubble and merge sort

18
Q

What is bubble sort?

A

A bubble sort works by repeatedly going through the list to be sorted comparing each pair of adjacent elements. If the elements are in the wrong order they are swapped.

19
Q

What is merge sort?

A

This is a 2 stage sort, in the first stage, the list is successively dividing in half, forming sublists, until each sublist is of length one. Then all the numbers recombine with the numbers swapping with whichever one is higher.