ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Teorema Maestro


Enviado por   •  2 de Junio de 2013  •  382 Palabras (2 Páginas)  •  769 Visitas

Página 1 de 2

Master Theorem:

Practice Problems and Solutions

Master Theorem

The Master Theorem applies to recurrences of the following form:

T(n)= aT(n/b)+f(n)

where a 1 and b> 1 are constants and f(n)is an asymptotically positive function.

There are 3 cases:

logb

a- )logb

a).

1. If f(n)= O(nfor some constant > 0, then T(n)= (n

2. If f(n)= (nlogb

a logk n)with1 k 0, then T(n)= (nlogb

a logk+1 n).

logb

a+ )

3. If f(n)=

(nwith > 0, and f(n)satisfies the regularity condition, then T(n)= (f(n)).

Regularity condition: af(n/b) cf(n)for some constant c< 1 and all sufficiently large n.

Practice Problems

For each of the following recurrences, give an expression for the runtime T(n) if the recurrence can be

solved with the Master Theorem. Otherwise, indicate that the Master Theorem does not apply.

2

1. T(n)=3T(n/2)+n

2

2. T(n)=4T(n/2)+n

3. T(n)= T(n/2)+2n

n

4. T(n)=2nT(n/2)+n

5. T(n)=16T(n/4)+n

6. T(n)=2T(n/2)+nlogn

1most of the time, k =0

1

7. T(n)=2T(n/2)+n/ logn

0.51

8. T(n)=2T(n/4)+n

9. T(n)=0.5T(n/2)+1/n

10. T(n)=16T(n/4)+n!

p

11. T(n)=2T(n/2)+logn

12. T(n)=3T(n/2)+n

p

13. T(n)=3T(n/3)+ n

14. T(n)=4T(n/2)+cn

15. T(n)=3T(n/4)+nlogn

16. T(n)=3T(n/3)+n/2

17.

...

Descargar como (para miembros actualizados)  txt (2.7 Kb)  
Leer 1 página más »
Disponible sólo en Clubensayos.com