Problem1359--单链表逆转

1359: 单链表逆转

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 0  Solved: 1
[Submit] [Status] [Web Board] [Creator:]

Description

本题要求实现一个函数,将给定的单链表逆转。 函数接口定义: List Reverse( List L ); 其中List结构定义如下: typedef struct Node *PtrToNode; struct Node { ElementType Data;

Input

L是给定单链表

Output

L是给定单链表

Sample Input Copy

5
1 3 4 5 2

Sample Output Copy

1
2 5 4 3 1

Source/Category