#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Lightbulb VBSCript - Large 2D Array - Sort - Issues


    Hello ,

    I have a 2D array of type as below.
    Need to sort it based on the second column , ie the Score.
    Score will always be a positive decimal.
    The number of rows will be between 400,000 to 900,000.
    Hence speed is very important

    Already tried Quicksort , speed is average
    But getting Out of Stack Space error , for certain cases (not all) of large number of rows.

    Ref :
    http://www.4guysfromrolla.com/webtech/012799-3.shtml

    This code sample works very well for my use , except for the stack space / time issues.
    Please assist for coding a sorting block for the array.

    Thanks



    Code:
    resultarray(0,1) = "Name1"
    resultarray(1,1) = "Score1"
    resultarray(2,1) = "Category1"
    resultarray(3,1) = "OtherDetail1"
    resultarray(4,1) = "OtherDetail1"
    resultarray(5,1) = "OtherDetail1"
    
    resultarray(0,2) = "Name2"
    resultarray(1,2) = "Score2"
    resultarray(2,2) = "Category2"
    resultarray(3,2) = "OtherDetail2"
    resultarray(4,2) = "OtherDetail2"
    resultarray(5,2) = "OtherDetail2"
    
    resultarray(0,3) = "Name3"
    resultarray(1,3) = "Score3"
    resultarray(2,3) = "Category3"
    resultarray(3,3) = "OtherDetail3"
    resultarray(4,3) = "OtherDetail3"
    resultarray(5,3) = "OtherDetail3"
  2. #2
  3. No Profile Picture
    Stumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,409
    Rep Power
    4538
    I believe you'll always have problems with arrays of the size you mention. I would recommend you put your data in a database and then you can let the dbms do the sorting.
    ======
    Doug G
    ======
    It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

IMN logo majestic logo threadwatch logo seochat tools logo