-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCitizenList.h
45 lines (33 loc) · 1.32 KB
/
CitizenList.h
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
#ifndef CITIZEN_LIST_H_
#define CITIZEN_LIST_H_
#include <iostream>
#include <string>
#include "BloomFilter.h"
#include "VaccinationInfoList.h"
typedef struct Citizen{
int citizenId;
struct VInfoNode* citizenIDptr;
string firstName;
string lastName;
string* country;
int age;
}Citizen;
typedef struct CitizenNode{
Citizen citizen;
struct CitizenNode* next;
}CitizenNode;
void CitizenListPrint(CitizenNode * head);
/* Add a new CitizenNode in the beginning of the list */
void CitizenListPush(CitizenNode ** head, Citizen cit, struct VaccinationInfo vacInfo);
/* Return "true" if "keyId" is in Citizen List or "false" if it isn't */
/* Also return the adrress of CitizenNode as an argument if keyId exists or NULL if it doesn't */
int CitizenListSearch(CitizenNode* head, int keyId, CitizenNode** found);
/* Return the number of nodes == citizens in list */
int CitizenListCount(CitizenNode* head);
/* Return the number of people that are from country "countryName" */
int CitizenListCount(CitizenNode* head, string countryName);
/* Return the number of people in each age group that are from country "country" */
void CitizenListCountByAge(CitizenNode* head, string countryName, float ageGroup[4]);
/* Delete all nodes in the list */
void CitizenDeleteList(CitizenNode** head);
#endif /* CITIZEN_LIST_H_ */