13082 - Merge sorted lists   

Description

This is a partial judge problem.

Given two sorted linked lists which length are N and M respectively, you need to merge them into one sorted list and delete the duplicated numbers.

function.h

typedef struct _Node {
    int data;
    struct _Node *next;
} Node;

Node* Merge_lists(Node*, Node*);

You only need to implement the Merge_lists(Node*, Node*) function which take two sorted linked list as input.

 

Input

First line contains two integers which denote the number of the integers of two sorted lists. (1 <= N.M <= 10, 1 <= each integer <= 30)

Second line contains N integers which denote the first given sorted list.

Third line contains M integers which denote the second given sorted list.

Output

One merged sorted linked list result.

Sample Input  Download

Sample Output  Download

Partial Judge Code

13082.c

Partial Judge Header

13082.h

Tags




Discuss