/*找出LA中多余的重复结点生成一个新的表LB。如有线性表LA=(2,3,4,3,5,6,7,4,8,9)存在多余重复结点则:
LB=(2,3,4,5,6,7,8,9)
*/
template<class T>
class shanchu<T>::void PURGE(T LA)
{
	int i=1,k,x,y;
	/* 每次循环使当第i个结点不重复的结点*/
	while (i<length(LA))
	{
		x=get(LA,i);
		k=i+1;
		while(k<length(LA))
		{
			y=get(LA,k);
			if (x==y)
			{
				Delete(LA,k);
			}
			else k++;
		}
		i++;
	}
}/*PURGE*/


相关文章:

  • 2022-12-23
  • 2021-12-09
  • 2021-08-03
  • 2022-02-19
  • 2022-12-23
猜你喜欢
  • 2021-12-16
相关资源
相似解决方案