head(tail(head(tail(H))))
(b)
(xyz)
(de)
GetHead(GetHead(GetTail(L)))
本算法中首先數組b中元素以逆置順序放入d數組中然後數組a和數組d的元素比較將大者拷貝到數組c第一個WHILE循環到數組a或數組d結尾第二個和第三個WHILE語句只能執行其中的一個
()b[mi+]()x:=a[i]()i:=i+()x:=d[j]()j:=j+ ()k:=k+()i<=l()j<=m
()(i==k) return()i+()i()i!=k
本算法利用快速排序思想找到第k個元素的位置(下標k因而開初有k)內層do循環以t(t=a[low])為樞軸找到其應在i位置這時若i等於k則算法結束(即第一個空格處if(i==k) return)否則若i<k就在i+至high中間去查若i>k則在low到i間去找直到找到i=k為止
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
From:http://tw.wingwit.com/Article/program/sjjg/201311/23064.html