Algorithms Flashcards
What are the components of an algorithm?
- finite number of steps
- unambigious steps
- deterministic
What is complexity ?
- Size in relation to run time (efficiency )
- measure of which one is faster
Perform a quick sort algorithm to sort it into ascending order
values less than or equal to go to the left of pivot
what is
* first fit
* first fit decreasing
* full bin
- FF: putting the numbers using given order in question
- FFD: ordering the list into descending order - biggest first
- FB: using brain for optimal solution
what does heuristic mean?
- a method that finds the solution efficently, but with no gurante that this solution is optimal
- important when classical methods fail, only way to find is exhauting all solutions
how can the efficency of different packing methods be tested?
counting the number of comparisions needed in worst case
what is the complexit of the first fit and first fit decreasing algorithm , in the worst case?
o (n sqaured)
what is the complexity of the quick sort algorithm , in the worst case?
O (n squared)
What is big O notation?
Use quick sort to sort the following numbers in descending order
Use quick sort to sort the following numbers in descending order