Académique Documents
Professionnel Documents
Culture Documents
2
Algorithm classification
$acktracking algorithms
'reedy algorithms
(andomi)ed algorithms
*
#imple recursive algorithms +
#tep past the first element, and count the remaining elements
in the list
+f the first thing in the list is the given value, return true0
otherise
#tep past the first element, and test hether the value occurs in
the remainder of the list
1
$acktracking algorithms
A backtracking algorithm"
Tests to see if a solution has been found, and if so, returns it0
otherise
(ecur
color56ountry n7"
=uicksort"
3ergesort"
To find the n
th
2ibonacci number"
To find the n
th
2ibonacci number"
Cou take the best you can get right no, ithout regard for
future conse&uences
a D. bill
a D: bill, to make D1
A :@ kron piece
Bptimi)ing" 2ind the best solutionE This may re&uire finding all
solutions, or if a value for the best solution is knon, it may stop
hen any best solution is found