a.单链表
List CreateList( List L, int n )
{
Position P;
L = ( Position )malloc( sizeof ( struct Node ));
L->next = NULL;
for ( int i = 0; i < n; i++ )
{
P = ( Position )malloc( sizeof( struct Node ));
scanf( "%d", &( P->x ));
P->next = L->next;
L->next = P;
}
return L;
}
void SwapAdjacentElements( List L, Position p1, Position p2 )
{
if ( p1->next != p2 )
{
printf("不是相邻的节点");
return;