1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
|
int merge(queue *a,queue *b)
{if (isempty(a) == 0 && isempty(b) == 0))
return 0;
else if isempty(a) != 0 && isempty(b) == 0)
return a;
else if isempty(a) == 0 && isempty(b) != 0)
return b;
else return merge((append(b,top(a)),rest(a))
}
|