Title Description:
The input is a one-way list, followed by the output of the value in the linked list. The linked list is defined as follows:
typedef struct TAGLISTNODE
{
int value;
struct Taglistnode *next;
}listnode;
Required Implementation functions:
void Converse (ListNode **head);
"Input" head: Chain head node, space has been opened up
"Output" head: The node of the linked list head after reverse order
"Back" none
"Note" Only needs to complete the function algorithm, the middle does not need any IO input and output
Returns the new linked header node linknode *reverse_link (linknode *head) { if (head = = null) return null; Linknode *prev, *curr, *reverse_head, *temp; Prev = NULL, Curr = head; while (Curr->next) { temp = curr->next; Curr->next = prev; prev = Curr; Curr = temp; } Curr->next = prev; Reverse_head = Curr; return reverse_head;
Huawei Machine Test-Reverse link list output