Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 3d questions
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Thu May 29, 2003 9:59 pm   Post subject: (No subject)

lol i tried the procedure for z sorting it slows the program downn like hell =/... what way did u use for z sorting in yer engine catalyst?
Sponsor
Sponsor
Sponsor
sponsor
Catalyst




PostPosted: Thu May 29, 2003 10:01 pm   Post subject: (No subject)

QuickSort (fastest one out there... arguably)

code:
procedure qSort (var a : array 1 .. * of real, var b : array 1 .. * of int, l, h : int)
    if l < h then
        var aH : real
        var bH : int
        var i : int := l;
        var j : int := h
        var mid : real := a (l)
        loop
            loop
                exit when a (i) >= mid
                i += 1
            end loop
            loop
                exit when a (j) <= mid
                j -= 1
            end loop
            if i <= j then
                aH := a (i)
                a (i) := a (j)
                a (j) := aH
                bH := b (i)
                b (i) := b (j)
                b (j) := bH
                i += 1
                j -= 1
            end if
            exit when i > j
        end loop
        qSort (a, b, l, j)
        qSort (a, b, i, h)
    end if
end qSort
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 2 of 2  [ 17 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: