Demo entry 6645462

222

   

Submitted by 222 on Oct 10, 2017 at 13:32
Language: C. Code size: 220 Bytes.

//反向顺序表
void fanxiang(list_type *lp)
{
	int j;
	for(j=lp->length; j>=0;j--)
	{
		int q = lp->data[j-1];//把最后一位元素提取出来
		lp->data[j]=lp->data[j-1];//把顺序表元素以此向后移动一位
		lp->data[0]= q;//把最后一位元素赋值给空出的第一位元素
	}//依次循环
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).