/* ------------------------------------------------------- */ /* ---- protótipos/headers das funções da biblioteca ----- */ /* ------------------------------------------------------- */ PNodoABP criarABPAleatoria (int, int); /* ------------------------------------------------------- */ /* -------------- implementação das funções -------------- */ /* ------------------------------------------------------- */ PNodoABP criarABPAleatoria (int A, int B) { int k, N; INFOABP X; PNodoABP T; N = gerarNumeroInteiro(A, B); T = criarABP(); k = 1; while (k <= N){ X = criarElementoABP(); if (pesquisarABP(X,T) == NULL){ T = inserirABP(X,T); k = k + 1; } } return T; }