Algorithms/ solving Problems Flashcards
existence problem
determining if there is a solution
construction problem
finding a solution to the problem
enumeration
finding how many solutions there are to a problem
optimisation
finding the best solution to a problem
pigeon hole principal
if there are m pigeonholes and n pigeons, where m
proper subset
a part of a set that is smaller than the original set
number of ways of arranging n objects where non are repeated
n!
if there are n numbers and r positions to arrange them and a number cannot be repeated then the number of ways of arranging the numbers is
n!/(n-r)!
choosing n items from a set of r where the order doesn’t matter
r!/n!
The number of combinations of r objects from n is
n!/(n-r)!r!
inclusion exclusion principal
|AUBUC| = |A|+|B|+|C|-|A∩B|-|B∩C|-|A∩C|+|A∩B∩C|
order of an algorithm
The value with the largest exponent with the coefficient
Bin packing algorithms
next-fit
first-fit
first-fit decreasing
Comparisons in bubble sort
decrements with each pass
Comparisons in shuttle sort
random