1 - Algorithms Flashcards

1
Q

Describe an algorithm. (1)

A

A finite sequence of step-by-step instructions carried out to solve a problem.

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

In a list of 8 numbers, what is the middle number? (Sorting)

A

5

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

In a flow chart: describe the shapes used for Start/End, Instruction and Decison

A

Rounded rectangle, rectangle, diamond

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

How is the lower bound of a bin packing algorithm found? (2)

A

Sum the terms, and divide by number of bins.
Always round up.

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

What is the order of an algorithm?

A

A measure of its efficiency as a function of the size of the problem.

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

An algorithm has order nlogn, and can sort 100 items in 0.3 seconds. Estimate the time needed for 100 items.

A

0.3 x (1000log(1000) / 100log(100))
= 0.3 x 15
= 4.5

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