-void generar_random (std::list<int> &lst, uint n)
-{
- /* Genero N numeros aleatorios entre -3*n y 3*n */
- bool *numeros = new bool [6*n+1];
- int random;
-
- memset (numeros, 0, (6*n+1)*sizeof (bool));
-
- srand (time (NULL));
- for (uint i=0; i < n; i++) {
- do {
- random = 1 + (int)(6.0f * n * rand () / (RAND_MAX + 1.0f) - 3.0f * n);
- std::cout << random << std::endl;
- } while (numeros[random + 3 * n] == true);
- numeros[random + 3 * n] = true;
- lst.push_back (random);
- }