logo

Crowdly

Browser

Додати до Chrome

* Contrôles Continus - P2 - Promo 2029

Шукаєте відповіді та рішення тестів для * Contrôles Continus - P2 - Promo 2029? Перегляньте нашу велику колекцію перевірених відповідей для * Contrôles Continus - P2 - Promo 2029 в moodle.myefrei.fr.

Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!

Soient les fonctions suivantes :

void fonction1(t_cell *ptr_c)

{

    printf("%d ", ptr_c->value);

    fonction1(ptr_c->next);

}

void fonction2(t_list mylist)

{

fonction1(mylist.head);

}

Quelle est l'affichage obtenu si on appelle la fonction2 sur la liste suivante ?

0%
0%
0%
0%
Переглянути це питання

Soient les fonctions suivantes :

void fonction1(t_cell *ptr_c)

{

    printf("%d ", ptr_c->value);

    fonction1(ptr_c->next);

}

void fonction2(t_list mylist)

{

fonction1(mylist.head);

}

Quelle est l'affichage obtenu si on appelle la fonction2 sur la liste suivante ?

0%
0%
0%
0%
Переглянути це питання

Soient les fonctions suivantes :

void fonction1(t_cell *ptr_c)

{

    printf("%d ", ptr_c->value);

    fonction1(ptr_c->next);

}

void fonction2(t_list mylist)

{

fonction1(mylist.head);

}

Quelle est l'affichage obtenu si on appelle la fonction2 sur la liste suivante ?

Переглянути це питання

Let be the following functions :

void fonction1(t_cell *ptr_c)

{

    printf("%d ", ptr_c->value);

    fonction1(ptr_c->next);

}

void fonction2(t_list mylist)

{

fonction1(mylist.head);

}

What is the display obtained if we call the function2 on the following list ?

Переглянути це питання

Consider the following function, which recursively searches for the maximum in a list :

int maxRecList(t_cell *cell, int cur_max)

{

if (cell == NULL) {

return cur_max;

}

if (cell->value > cur_max) {

cur_max = cell->value;

}

return maxRecList(cell->next, cur_max);

}
we want to call this function from the main program, for a non-empty list named list_1.

Which main program is used to make this call to obtain the correct result ?

(we assume that all the right #includes have been made)

Переглянути це питання

Let be the following functions :

void fonction1(t_cell *ptr_c)

{

    printf("%d ", ptr_c->value);

    fonction1(ptr_c->next);

}

void fonction2(t_list mylist)

{

fonction1(mylist.head);

}

What is the display obtained if we call the function2 on the following list ?

Переглянути це питання

On souhaite 'détruire' une liste, c'est à dire libérer (free()) toutes les cellules qui la constituent

on vous propose la fonction suivante :

void destroyList(t_list *ptr_list)

{

   t_cell *cur;

   t_cell *prev;

   while (ptr_list->head !=NULL)

   {

      cur = ptr_list->head;

      prev = cur;

      while (cur->next != NULL)

      {

           prev = cur;

           cur = cur->next;

      }

      prev->next = NULL;
      free(cur);

}
}

 

Que pouvez-vous dire de cette fonction ? (plusieurs réponses)

Переглянути це питання

We want to 'destroy' a list, i.e. free() all the cells in it.

we propose the following function :

void destroyList(t_list *ptr_list)

{

   t_cell *cur;

   t_cell *prev;

   while (ptr_list->head !=NULL)

   {

      cur = ptr_list->head;

      prev = cur;

      while (cur->next != NULL)

      {

           prev = cur;

           cur = cur->next;

      }

      prev->next = NULL;
      free(cur);

}
}

 

What can you say about this function? (several answers)

Переглянути це питання

the following function performs a chain at the head of the list (adds a new cell to the head) :

(we assume that the function t_cell *createCell(int); creates a new individual cell)

void addHead(t_list *p_list, int val)

{

    t_cell *new = createCell(val);

    p_list->head = new;

    new->next = p_list->head;
}

0%
100%
Переглянути це питання

la fonction suivante effectue bien un chaînage en tête de liste (ajoute une nouvelle cellule en tête) :

(on suppose que la fonction t_cell *createCell(int); crée bien une nouvelle cellule individuelle)

void addHead(t_list *p_list, int val)

{

    t_cell *new = createCell(val);

    p_list->head = new;

    new->next = p_list->head;
}

0%
0%
Переглянути це питання

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.myefrei.fr?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome