Algorithms Flashcards
Algorithm
A finite sequence of step-by-step instructions carried out to solve a problem
Flow Chart
The shape of each box tells you about its function:
Oval -Start/Finish
Rectangle - Instruction
Diamond - Decision
How would you order unordered lists?
Using bubble sort or quick sort
Advantage of First Fit bin packing?
Quick to implement
Disadvantage of first fit bin packing?
Not likely to lead to an optimal solution
Advantage of first-fit decreasing bin packing?
- Usually a good solution
- Easy to implement
Disadvantage of first-fit decreasing bin packing?
May not get an optimal solution
Advantage of full-bin bin packing?
Usually a good solution
Disadvantage of full-bin bin packing?
Difficult to implement, especially when numbers are awkward and plentiful
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?
Approximately f(m)/f(n)
Number of comparisons in a pass of bubble sort?
N-1