数据结构_单链表的遍历


#include 
#include 
typedef int ElementType;
#include "_List.h"
#include "_List.c"

int main()
{
	List L;
	Position P;
	L = CreateList();

	Insert( 5, L, L );
	Insert( 4, L, L );
	Insert( 3, L, L );
	Insert( 2, L, L );
	Insert( 1, L, L );

	P = L->Next;
	while( P != NULL )
	{
		printf( "%d ", P->Element );
		P = P->Next;
	}

	return 0;
}

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注