The Algorithm
1. FindZero(i,j)
2. if j = i then
3. return T[i] =0
4. else
5. k <- i+[(j-i)/2] (I cant make the correct panrenthesis, but they are meant to round down)
6. if T[k] > or = 0 then
7. return FindZero(i,k)
8. else
9. return FindZero(k+1, j)
N = 12
and T are shown in this table:
| -211 | -101 | -80 | -45 | 0 | 3 | 42 | 80 | 204 | 320 | 325 | 531 |
I have to run FindZero(1,12) and I'm really not diciplined enough to trust my calculations.
Could you help me with this first step?


LinkBack URL
About LinkBacks
