习题3.3---只通过调整指针来达到相邻结点交换的过程
//单链表 void ExchangeNear( List L, Position PosBefoP ) { Position PosL,PosR; PosL = PosBefoP->Next; PosR = PosL->Next; PosL->Next = PosR->Next; PosR->Next = PosL; PosBefoP->Next = PosR; } //双链表 void ExchangeNear( Position PosBefoP, List L ) { Position P,PosAfteP; P = PosBefoP->Next; PosAfteP = P->Next; P->Next = PosAfteP->Next; P->front = PosAfteP; PosAfteP->Next = P; PosAfteP->front = PosBefoP; PosBefoP->Next = PosAfteP; }