Lukas alkauskas wrote: > Hi everyone, I want to know what is the best way to sort these(as example) > type of structure. > > example: > > > struct Qualification { > > int qualif; > > int pay; > > }; > > > > struct QualificationList { > > Qualification info; > > QualificationList *next; > > }; > > > > class TQualification { > > private: > > QualificationList *Q; > P.S. > Thanks for your answers.
Though you usually see them implemented with arrays, both Quicksort and Mergesort can be very efficiently coded to work on linked lists rather than arrays. One thing to remember is that after you have sorted a randomly ordered linked list by changing "next" pointers, those pointers now reference memory in random order! This can produce terrible performance problems due to cache and page misses. Cheers! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---