Thread: Quicksort help!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    7

    Quicksort help!

    Hi all,

    I have written a quicksort algo that works fine on a array of ints. My problem however is that I will be sorting a few millions structs based on its int member.

    My task has to split the few millions structs into sections of 750. So I will have 750 structs then list[1] will be another 750 structs and then list[2] will have another 750 all the way to a few million. So my question is how can I sort the array when it is structured in this seperated way, or can I just create the structs in one large array say struct MyList mine[4000000] and then input the sorted data into the seperated sections.

    I hope this is clear, thanks.

    A bit more explanation, I would have a structure like:

    list[10]
    section[6]
    struct obj->int value to sort by

    So in this case there would be 10 entries of 6 structs. So 60 obj structs all together that need to be sorted by their int value. However in real scale there would be maybe 3-4 million obj structs, so I dont think I can do struct obj list[3000000] and sort that, I would have to sort it in its seperated form.
    Last edited by zeronero; 02-17-2012 at 04:08 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. quicksort
    By thescratchy in forum C Programming
    Replies: 3
    Last Post: 03-15-2010, 12:44 PM
  2. Help with quicksort
    By c++prog in forum C++ Programming
    Replies: 12
    Last Post: 11-24-2009, 11:01 PM
  3. quicksort
    By WelshGrandSlam in forum C++ Programming
    Replies: 8
    Last Post: 01-23-2008, 08:15 PM
  4. Quicksort again
    By rvanbeusichem in forum C Programming
    Replies: 3
    Last Post: 11-25-2004, 04:32 AM
  5. quicksort
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 01-12-2002, 02:07 AM