/* ------------------------------------------------------- */ /* --------------- library function headers -------------- */ /* ------------------------------------------------------- */ // to create a list with randomly generated data, where // the size is a value between two given integer numbers PNodoLista criarListaAleatoria (int, int); /* ------------------------------------------------------- */ /* ------------- implementation of functions ------------- */ /* ------------------------------------------------------- */ PNodoLista criarListaAleatoria (int A, int B) { PNodoLista L; int N, k; INFOLista X; L = criarLista(); N = gerarNumeroInteiro(A, B); k = 1; while (k <= N){ X = criarElementoLista(); if(pesquisarLista(X, L) == 0){ L = inserirListaInicio(X, L); k = k + 1; } } return L; }