12113 - EECS_2018_FINAL_2   

Description

「與練習題相同」

Writer: jjjjj19980806       Description: pclightyear        Difficulty: ★☆☆☆☆

Given a linked list, you have to reverse it and output the result.

You have to implement four function:

1. Node* Create_List(Node*, int);

This function is used to create the linked list according to the input.

2. Node* Reverse_List(Node*);

This function is used to reverse the given linked list.

3. void Print_List(Node*);

This function is used to print out the key value in the linked list.

4. void Free_List(Node*);

This function is used to free the memory space.

Input

The first line contains one integer n, representing the number of nodes in the linked list.

The next lines contains n integers, each integer represents a node in the linked list.

It is guaranteed that :

  • 1 ≤ n ≤ 10
  • 0 ≤ ai ≤ 100

Output

You need to output the reversed linked lists.

Each key value is separated by "->".

Sample Input  Download

Sample Output  Download

Partial Judge Code

12113.c

Partial Judge Header

12113.h

Tags




Discuss