Professional Documents
Culture Documents
Daaunit 5
Daaunit 5
Daaunit 5
• Given any comparison-based algorithm with input list L[0:n-1] = {x1, x2, ...,
xn}, (internal) nodes in the comparison tree T associated with the algorithm
correspond to comparisons performed by the algorithm between list
elements. For specificity, our convention will be that if the comparison is
made between xi and xj, and i < j, then we will label the corresponding
node xi:xj. If xi < xj, then a left child will be the node corresponding to the
next comparison made next by the algorithm, or this left child will be a leaf
node if the algorithm terminates. Similarly, if xi > xj (we can assume distinct
list elements for the purpose of establishing lower bounds), then the right
child will be the node corresponding to the next comparison made by the
algorithm, or will be a leaf node if the algorithm terminates.
Oracles and Advisory Arguments
Merging
State Space Method
NP Hard and NP Complete Problems
Deterministic Algorithms
• If the result of every operation is defined in an algorithm then it is
a deterministic algorithm.
Non deterministic Algorithms
• A nondeterministic alogrithm terminates
unsuccessfully if and only if there exists no set
of choices leading to a success signal.