Algorithms Flashcards

1
Q

Algorithm

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

Flow Chart

A

The shape of each box tells you about its function:

Oval -Start/Finish

Rectangle - Instruction

Diamond - Decision

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

How would you order unordered lists?

A

Using bubble sort or quick sort

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

Advantage of First Fit bin packing?

A

Quick to implement

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

Disadvantage of first fit bin packing?

A

Not likely to lead to an optimal solution

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

Advantage of first-fit decreasing bin packing?

A
  • Usually a good solution

- Easy to implement

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

Disadvantage of first-fit decreasing bin packing?

A

May not get an optimal solution

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

Advantage of full-bin bin packing?

A

Usually a good solution

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

Disadvantage of full-bin bin packing?

A

Difficult to implement, especially when numbers are awkward and plentiful

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

If an algorithm has order f(n), then increasing the size of the problem from n to m will increase run time of the algorithm by a factor of?

A

Approximately f(m)/f(n)

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

Number of comparisons in a pass of bubble sort?

A

N-1

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