Saturday, October 15, 2005

[VBScript] sorting algorithms

Thanks to Dr Hans Werner Lang for his helpful comments on the sorting routines, as below:
but there is no need to rewrite the outer loop, is it?
    for i=h to n-1

The inner loop, with the problem of the conditional And, could be written as
    do while j>=h
        if a(j-h)<=t then exit do

In my opinion, exit do should be avoided (when possible).

H.W. Lang
I've made the changes to the class as suggested but haven't posted them as yet.

No comments: