PAII-26: algoritmos glotones - Cimat
PAII-26: algoritmos glotones - Cimat
PAII-26: algoritmos glotones - Cimat
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Unos ejemplos<br />
Ejemplo: selección de actividades<br />
Implementación muy simple:<br />
s t d : : v e c t o r e , t , s o l u t i o n ;<br />
. . . // Aqui r e l l e n a m o s l o s v e c t o r e s con l o s d a t o s<br />
i n t N = e . s i z e ( ) ;<br />
i n t m = 0 ; s o l u t i o n . push back (m) ;<br />
f o r ( i n t i =0; i =t . at (m) ) {<br />
m = i ;<br />
s o l u t i o n . push back (m) ;<br />
}<br />
}<br />
,<br />
J.B. Hayet Programación, Mayo 2008 14 / <strong>26</strong>