Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- void gravar(string metodo, string op, int ocup, int nop)
- {
- ofstream arq("saida.txt", ofstream::app);
- arq<<metodo<<";"<<op<<";"<<ocup<<";"<<nop<<"\n";
- }
- int main()
- {
- srand(time(NULL));
- THash tab;
- inicializa(tab);
- for(int i=1 ; i<=2000; i++)
- {
- int chave = rand()%32000+1;
- insere(tab, chave);
- if(i == 90 || i== 240 || i==740 || i == 990 || i==1990 )
- {
- int ocup=(i+10)/10;
- for(int j=0 ; j<20; j++)
- {
- chave = rand()%32000+1;
- int nop;
- nop = inserirTEA(tabela, chave);
- gravar("Endeaberto", "insercao", ocup, nop);
- chave = rand()%32000+1;
- nop = pesquisarTHEA(tabela, chave);
- gravar("Endeaberto", "pesquisa", ocup, nop);
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement