-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
82 lines (61 loc) · 1.64 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include "Part3/menu.h"
#include "Part3/docsFunction.h"
#include "Part2/recherche.h"
#include "timer.h"
int main() {
/* PART 1/2
printf("Creation des cellules\n");
LevelList *testList= createLevelList(500000);
createNCells(500000,testList);
Levels* levels= createLevelsTab(500000);
getTabLevel(levels);
addLevelToList(testList,levels);
updateLevelList(testList);
printf("\n");
//displayAllLevelList(testList);
printf("\n");
printf("t");
printf("\n");
startTimer();
Cell* searchedCell;
for(int i=0;i<200000;i++){
searchedCell=searchingValueLevel0(testList,rand()%500000);
}
stopTimer();
displayTime();
printf("\n");
printf("\n");
printf("\n");
printf("t2");
printf("\n");
startTimer();
Cell* searchedCell2;
for(int i=0;i<200000;i++){
searchedCell2 = searchValueDichotomiqueInList(rand()%2500000,testList);
}
stopTimer();
displayTime();
*/
/* PART 3*/
int* status = (int*)malloc(sizeof(int));
int choice;
*(status)=1;
Agenda *agenda= createAgenda();
char* lastname;
char* firstname;
char* fullname;
Contact *person;
for(int i=0;i<100;i++){
lastname=getLastNameFromDoc(rand()%10000);
firstname=getFirstNameFromDoc(rand()%10000);
fullname = makeFullName(lastname,firstname);
person = createContactWithValues(firstname,lastname,fullname);
addContactToAgenda(agenda, person );
}
while(*status){
choice = functionMenu();
switchChoice(choice,agenda,status);
}
printf("Merci d'avoir utilisé cet agenda !");
return 0;
}