-->
当前位置:首页 > 题库

PROGRAMMING:Merging of two ordered linked list sequences

Luz5年前 (2021-05-10)题库411
Given two non descending linked list sequences S1 and S2, we design a function to construct a new non descending linked list S3 after merging S1 and S2.
###Input format:
The input is divided into two lines. In each line, a non descending sequence composed of several positive integers is given. The end of the sequence is represented by $$- 1 $$($- 1 $$does not belong to this sequence). The numbers are separated by spaces.
###Output format:
Output the new non descending linked list after merging in one line, separate the numbers with spaces, and do not have extra spaces at the end; If the new linked list is empty, output 'null'.
###Input example:
```in
1 3 5 -1
2 4 6 8 10 -1
```
###Output example:
```out
1 2 3 4 5 6 8 10
```






answer:If there is no answer, please comment