Looking for * Contrôles Continus - P2 - Promo 2029 test answers and solutions? Browse our comprehensive collection of verified answers for * Contrôles Continus - P2 - Promo 2029 at moodle.myefrei.fr.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
void createEmptyList(t_list *ptr_list){ ptr_list->head = NULL;}
When is the use of a simple linked list (a single head pointer) less efficient than an array ?
En appelent la fonction suivante, on peut initialiser une liste vide dans le programme principal :
void createEmptyList(t_list *ptr_list){ ptr_list->head = NULL;}
Dans quel cas l'utilisation d'une liste chaînée simple (un seul pointeur head) est-elle moins efficace qu'un tableau ?
Consider the following program, using a pointer to a cell (assume that the type t_cell is well defined)
#include <stdio.h>#include <stdlib.h>#include "cell.h"int main(){ t_cell *ptr; ptr = (t_cell *)malloc(sizeof(t_cell)); ptr->value = 64738; printf("%d\n",ptr->value);
ptr->next = NULL; printf("%x\n", ptr->next); // display in hexadecimal, any value printf("%d\n",ptr->next->value); return 0;}What output does this program provide?
Soit le programme suivant, utilisant un pointeur vers une cellule (on considère que le type t_cell est bien défini)
#include <stdio.h>#include <stdlib.h>#include "cell.h"int main(){ t_cell *ptr; ptr = (t_cell *)malloc(sizeof(t_cell)); ptr->value = 64738; printf("%d\n",ptr->value);
ptr->next = NULL; printf("%x\n", ptr->next); // affichage en hexadécimal, une valeur quelconque printf("%d\n",ptr->next->value); return 0;}
Quelle sortie fournit ce programme ?
?
Quel est le rôle du mot clé struct en langage C ?
Soient les fonctions suivantes :
void fonction1(t_cell *ptr_c){ if (ptr_c != NULL) { fonction1(ptr_c->next); printf("%d ", ptr_c->value); }}
void fonction2(t_list mylist){ fonction1(mylist.head);}
Quelle est l'affichage obtenu si on appelle la fonction2 sur la liste suivante ?