PROC LinkedListSelectSort( head: pointer);
//本算法一趟找出一个关键字最小的结点其数据和当前结点进行交换;若要交换指针则须记下
//当前结点和最小结点的前驱指针
p:=head↑next;
WHILE p<>NIL DO
[q:=p↑next; r:=p; //设r是指向关键字最小的结点的指针
WHILE <q<>NIL DO
[IF q↑data<r↑data THEN r:=q;
q:=q↑next;
]
IF r<>p THEN r↑data<>p↑data
p:=p↑next;
]
ENDP;
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []