Empleador activo
Write C code that reverses a linked list
Anónimo
node* prev = NULL; node* curr = head; node* next; while(curr != NULL) { next = current->next; current->next = prev; prev = current; current = next; } node* reversed = prev;
node* p = pHead; // so P is now pointing to the head of the linked list. node* r = p; // r will point in reverse order while ( p != NULL ) { r = p = p->next; } basically r ends up pointing to the end of list, i.e reverse order.
Sigue a tus empresas favoritas para estar al tanto de las últimas oportunidades y disponer de información desde adentro.
Recibe recomendaciones y actualizaciones personalizadas al iniciar tu búsqueda.