Algorithms Flashcards

1
Q

Sum of triangular numbers complexity

A

1/2n(n-1)

Therefore quadratic

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

First fit

A

Pack each box in turn into first available bin into which it will fit
- complexity = quadratic.

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

First fit decreasing

A
  • reorder largest to smallest
  • apply first fit
  • complexity = quadratic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Full bin

A
  • look for combos yourself
  • not an algorithms because it is ambiguous - is heuristic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

quick sort

A

Pivot number compared to every number, slide all numbers less than it to the left of it, in the same order they were
- quadratic complexity in worst case

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

Algorithms are

A
  • unambiguous
  • deterministic
  • finite
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Heuristic algorithm definition

A
  • will usually find a good solution although not necessarily an optimal solution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Bubble sort shuttle sort complexity

A

Quadratic

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

Put values less than or equal to the pivot

A

to the left of the pivot

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