12944 - Traversal Linked List in Reverse Order
|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
| Case 5 |
1 sec |
32 MB |
Description
Please use the provided two files, main.c and function.h, to implement methods:
- Insert nodes to a list.
- Traversal a linked list in reverse order.
Go download function.c, and only need to submit function.c.
Input
n
N1 N2 N3 N4 … Nn
Note:
- n represents how many numbers would be provided.
- 32,767 >= n >= 0.
- 32,767 >= N(n) >= -32768.
Output
Output should follow below format:
Print: N1 N2 N3 N4 … Nn
Reverse: Nn Nn-1 Nn-2 … N1
Note that:
- Need to have a return value('\n') at the end of your output.
- Need a ‘Space’ between ‘:’ and N1.
- Need a ‘Space’ between any two numbers.
Partial Judge Code
12944.c
Partial Judge Header
12944.h
Tags