data_a=[[98, 1], [93, 2], [89, 3], [88, 4], [83, 5], [78, 6], [73, 7], [68, 8], [66, 9], [63, 10], [62, 11], [57, 12], [56, 13], [54, 14], [49, 15], [47, 16], [42, 17], [39, 18], [35, 19], [30, -1]]
data_b=[[97, 1], [93, 2], [91, 3], [87, 4], [83, 5], [78, 6], [75, 7], [74, 8], [72, 9], [70, 10], [69, 11], [66, 12], [62, 13], [61, 14], [59, 15], [55, 16], [51, 17], [50, 18], [46, 19], [42, 20], [37, 21], [36, 22], [32, 23], [31, 24], [28, -1]]
head_a=0
head_b=0
k_a=head_a
q_a=head_a
k_b=head_b
while(k_a!=-1 and k_b!=-1):
if data_a[k_a][0]>=data_b[k_b][0]:
q_a=k_a
__________
else:
if k_a==head_a:#在链表data_a的头部插入节点
data_a.append([data_b[k_b][0],head_a])
head_a=len(data_a)-1
__________
k_b=data_b[k_b][1]
else:
data_a.append([data_b[k_b][0],k_a])
data_a[q_a][1]=len(data_a)-1
__________
__________
while k_b!=-1:
data_a.append([data_b[k_b][0],-1])
data_a[q_a][1]=len(data_a)-1
q_a=data_a[q_a][1]
__________
tmp=head_a
while __________:
print(data_a[tmp][0],end=" ")
tmp=data_a[tmp][1]
print(data_a[tmp][0])