Algorithm Chapter Four
Algorithm Chapter Four
1. Forward Approach
2. Backward Approach
2𝑛 1
OR C(n)= 𝑛
∗ for n>0,c(0)=1.
𝑛+1
6 1
E.g. If number of nodes/keys are 3. c(3)= 3
* =5.
3+1
29
Compiled by: Gizachew Melkamu(MSc in CS)
Dynamic Approach
Consider the below table, which contains the keys and frequencies.
• Objective: maximize b
iT
i
• Constraint:
w
iT
i W
Compiled by: Gizachew Melkamu(MSc in CS) 67
Cont…
71
Compiled by: Gizachew Melkamu(MSc in CS)
Compiled by: Gizachew Melkamu(MSc in CS) 72
Cont…
• Thus if ri =0.80 and mi = 2, the stage reliability becomes 0.96.
Reliability = 1- (1 - 0.80)2
= 1- (0.2)2
= 1 – 0.04
= 0.96 The reliability of this stage increased with duplication.
79
Compiled by: Gizachew Melkamu(MSc in CS)
Cont..