Answer:1. [Initialization]
g <-- lb + 1
s <-- ub
flag <-- 0
key <-- sortarray [lb]
temp.
2. [Check we have single element array or not]
if lb < ub
[Repeat until key value is position at its final position]
while flag =0
[Position g no greater than key]
Repeat while sortarray [g] < key
Increment g by 1.
Repeat while sortarray [s] > key
Decrement s by 1.
[Check whether s is pointing to lower position]
if g < s
[Exchange values of g and s]
else
flag = 1
[Exchange the s with key position]
Call quicksort (sortarray,lb,s-1)
Call quicksort (sortarray,s+1,ub)