Información

Autor(es) Jean-Luc Bibaud Anthony Doeraene
Fecha de entrega Sin fecha de envío
Tiempo límite de envío Sin límite de envío

Etiquetas

Inicia sesión

Reverse

In this exercice you are asked to implement a function to reverse a given linked list. So for example if your input is a list in the form a->b->c, your output should be c->b->a. You can implement this with recursion if you so desire.

You have a linked list composed of nodes.

typedef struct node{
    int val;
    struct node *next;
} node_t;

Pregunta 1: Reverse
/*
* Reverses linked list
*
* pre         : head will not be null
*
* @return     : the head of the list reversed
*               NULL if a malloc fails
*/
node_t* reverse(node_t* head){
Pregunta 2: Auxiliary functions

Write here your auxiliary functions