算法2.2,两个有序线性表La,Lb的合并。,要求: 线性表La、Lb中的数据元素按值非递减有序排列,合并La、Lb构造Lc,使Lc中的数据元素仍按值非递减有序排列。,例,La = ( 3, 5, 8, 11 )Lb = ( 2, 6, 8, 9, 11, 15, 20 ),构造 Lc = ( 2, 3, 5, 6, 8, 8, 9, 11, 11, 15, 20 ),思想:,La_len = ListLength ( La ); Lb_len = ListLength ( Lb );,InitList ( Lc );,i = j = 1;k = 0;,GetElem ( La,i,a );GetElem ( Lb,j,b );,/ 处理超长部分,/ 处理超长部分,La_len = ListLength ( La ); Lb_len = ListLength ( Lb );,