Results 1 to 4 of 4

Thread: Fast Sort

  1. #1
    Guest

    Post

    Hi,

    Does anybody know of a routine to sort a string array VERY fast? I have been using a BubbleSort routine I wrote, but it's pretty slow. I have tried some other sort routines, but they also are slow.

    Thanks

    ------------------
    Richard Moss

    [email protected]
    http://www.users.globalnet.co.uk/~ariad/


  2. #2
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    It could be classed as cheating but I would create a listbox on the form, make it invisible, set it's Sorted property to TRUE and do this;

    Listbox1.clear
    For i=0 to 100
    listbox1.additem myarray(i)
    next
    for i=0 to listbox1.listcount-1
    myarray(i)=listbox.list(i)
    next

    I haven't tested this but it should be ok - you're just writing stuff into a listbox, and then reading it out - providing the array isn't that massive it should be quite quick.




    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



  3. #3
    Guest

    Post

    Mark,

    Thanks for the reply.

    Unfortuantly, in this case this is not an option, as the sort is required in a class module and everything must be pure self contained code.

    Thanks anyway!

    ------------------
    Richard Moss

    [email protected]
    http://www.users.globalnet.co.uk/~ariad/


  4. #4
    Guest

    Post

    Check out htis site:
    http://www.cs.ubc.ca/spider/harrison...ting-demo.html

    It has demos and code for all kinds of sorts.

    ------------------
    Boothman
    There is a war out there and it is about who controls the information, it's all about the information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width