SAE S1.02 - Comparaison d'approches algorithmiques
structures.h
Aller à la documentation de ce fichier.
1 
6 #include <string.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 
10 /* Partie 1 */
16 typedef struct maillonDept
17 {
18  char departement[30];
19  int nbP;
20  char resp[30];
21  struct maillonDept *suiv;
29 typedef struct
30 {
31  char ville[30];
33 } VilleIUT;
34 
35 /* Partie 2 */
41 typedef struct
42 {
43  char ville[30];
44  char departement[30];
47 } Choix;
48 
54 typedef struct maillonChoix
55 {
57  struct maillonChoix *suiv;
65 typedef struct
66 {
67  int num;
68  char nom[22];
69  char prenom[22];
70  float tabNotes[5];
71  int nbChoix;
73 } Etudiant;
74 
75 enum
76 {
77  maths,
78  francais,
79  anglais,
80  spe,
81  moy
82 };
83 
84 /* ListeDept */
85 ListeDept listenouv(void);
86 ListeDept insererEnTete(ListeDept ld, char departement[], int nbP, char resp[]);
87 ListeDept inserer(ListeDept ld, char departement[], int nbP, char resp[]);
88 void afficher(ListeDept ld);
89 bool vide(ListeDept ld);
90 void afficherDept(ListeDept ld);
91 int rechercheDept(ListeDept ld, char departement[], bool *trouve);
93 ListeDept supprimer(ListeDept ld, char departement[]);
94 int longueur(ListeDept ld);
95 int getNbP(ListeDept ld, int pos);
96 void setNbP(ListeDept ld, int pos, int valeur);
97 char *getResp(ListeDept ld, int pos);
98 void setResp(ListeDept ld, int pos, char valeur[]);
99 char *getDept(ListeDept ld, int pos);
100 void setResp(ListeDept ld, int pos, char valeur[]);
101 
102 /* ListeChoix */
110 bool videChoix(ListeChoix lc);
111 void afficherChoix(ListeChoix lc);
112 int longueurChoix(ListeChoix lc);
114 char *getDeptChoix(ListeChoix lc, int pos);
115 char *getVilleChoix(ListeChoix lc, int pos);
116 int trouverPos(ListeChoix lc, char ville[], char dept[]);
117 void setDecisionAdmission(ListeChoix lc, int pos, int val);
Structure d'un choix.
Definition: structures.h:42
int decisionAdmission
Definition: structures.h:45
int decisionCandidat
Definition: structures.h:46
Structure d'un candidat.
Definition: structures.h:66
int nbChoix
Definition: structures.h:71
ListeChoix lChoix
Definition: structures.h:72
int num
Definition: structures.h:67
Structure d'une ville possédant un IUT.
Definition: structures.h:30
ListeDept ldept
Definition: structures.h:32
Maillon d'une liste de choix.
Definition: structures.h:55
struct maillonChoix * suiv
Definition: structures.h:57
Choix choix
Definition: structures.h:56
Maillon d'une liste de départements.
Definition: structures.h:17
int nbP
Definition: structures.h:19
char departement[30]
Definition: structures.h:18
char resp[30]
Definition: structures.h:20
struct maillonDept * suiv
Definition: structures.h:21
void setResp(ListeDept ld, int pos, char valeur[])
Modifie le nom du responsable d'un département.
Definition: structuresP1.c:257
int longueurChoix(ListeChoix lc)
Retourne la longueur d'une liste de choix.
Definition: structuresP2.c:186
struct maillonChoix MaillonChoix
Maillon d'une liste de choix.
void afficherChoix(ListeChoix lc)
Affiche tous les choix d'une liste.
Definition: structuresP2.c:169
char * getDeptChoix(ListeChoix lc, int pos)
Retourne le département d'un choix.
Definition: structuresP2.c:216
void afficherCandidatsChoix(Choix choix)
Affiche un choix.
Definition: structuresP2.c:203
ListeChoix listenouvChoix(void)
Retourne une nouvelle liste vide.
Definition: structuresP2.c:14
struct maillonDept MaillonDept
Maillon d'une liste de départements.
char * getResp(ListeDept ld, int pos)
Retourne le nom du responsable d'un département.
Definition: structuresP1.c:240
int trouverPos(ListeChoix lc, char ville[], char dept[])
Retourne la position dans la liste de choix d'un choix recherché
Definition: structuresP2.c:268
ListeDept inserer(ListeDept ld, char departement[], int nbP, char resp[])
Insère un département dans une liste de départements en respectant l'ordre alphabétique.
Definition: structuresP1.c:57
ListeDept insererEnTete(ListeDept ld, char departement[], int nbP, char resp[])
Insère un département en tête d'une liste de départements.
Definition: structuresP1.c:31
ListeChoix supprimerEnTeteChoix(ListeChoix lc)
supprime le choix en tête d'une liste
Definition: structuresP2.c:74
ListeDept supprimer(ListeDept ld, char departement[])
Supprime un département particulier d'une liste de départements.
Definition: structuresP1.c:214
struct maillonDept * ListeDept
ListeChoix supprimerChoix(ListeChoix lc, Choix choix)
Supprime un choix particulier dans une liste.
Definition: structuresP2.c:96
bool vide(ListeDept ld)
Vérifie si une liste est vide.
Definition: structuresP1.c:117
void setDecisionAdmission(ListeChoix lc, int pos, int val)
Modifie la décision d'un département.
Definition: structuresP2.c:250
bool rechercheChoix(ListeChoix lc, Choix choix)
Recherche un choix dans une liste.
Definition: structuresP2.c:121
ListeChoix insererChoix(ListeChoix lc, Choix choix)
Insère un nouveau choix dans une liste dans l'ordre alphabétique de la ville et du département.
Definition: structuresP2.c:51
struct maillonChoix * ListeChoix
char * getVilleChoix(ListeChoix lc, int pos)
Retourne la ville d'un choix.
Definition: structuresP2.c:233
int getNbP(ListeDept ld, int pos)
Retourne le nombre de places dans un département.
Definition: structuresP1.c:159
void setNbP(ListeDept ld, int pos, int valeur)
Modifie le nombre de places dans un département.
Definition: structuresP1.c:176
void afficherDept(ListeDept ld)
Affiche le nom de tous départements dans une liste de départements.
Definition: structuresP1.c:98
char * getDept(ListeDept ld, int pos)
Retourne le nom d'un département.
Definition: structuresP1.c:274
ListeDept listenouv(void)
Retourne une nouvelle liste vide.
Definition: structuresP1.c:14
Choix TeteChoix(ListeChoix lc)
Retourne le choix en tête de liste.
Definition: structuresP2.c:140
ListeChoix insererEnTeteChoix(ListeChoix lc, Choix choix)
Insère un choix en tête de d'une liste.
Definition: structuresP2.c:29
bool videChoix(ListeChoix lc)
Vérifie si une liste est vide.
Definition: structuresP2.c:158
void afficher(ListeDept ld)
Affiche tous les départements dans une liste de départements.
Definition: structuresP1.c:81
ListeDept supprimerEnTete(ListeDept ld)
Supprime le département en tête d'une liste de départements.
Definition: structuresP1.c:192
int rechercheDept(ListeDept ld, char departement[], bool *trouve)
Recherche un département dans une liste de départements.
Definition: structuresP1.c:131
int longueur(ListeDept ld)
Retourne la longueur d'une liste de départements.
Definition: structuresP1.c:290