主题:求快速排序的主程序!moz来帮忙啊
SUB qs (a(), i, r)
IF i >= r THEN EXIT SUB
i = 1
j = r
x = a(i)
DO
WHILE (a(j) > x) AND (j > i)
j = j - 1
WEND
IF i < j THEN
a(i) = a(j): i = i + 1
WHILE (a(i) < x) AND (j > i)
i = i + 1
WEND
END IF
IF i < j THEN a(j) = a(i): j = j - 1
LOOP UNTIL i = j
a(i) = x
i = i + 1
j = j - 1
qs a(), i, j
qs a(), i, r
END SUB
子程序在此,请大家帮帮我,主程序怎么办?
IF i >= r THEN EXIT SUB
i = 1
j = r
x = a(i)
DO
WHILE (a(j) > x) AND (j > i)
j = j - 1
WEND
IF i < j THEN
a(i) = a(j): i = i + 1
WHILE (a(i) < x) AND (j > i)
i = i + 1
WEND
END IF
IF i < j THEN a(j) = a(i): j = j - 1
LOOP UNTIL i = j
a(i) = x
i = i + 1
j = j - 1
qs a(), i, j
qs a(), i, r
END SUB
子程序在此,请大家帮帮我,主程序怎么办?