linklist and memory issues I have a doubly link-list like this

typedef struct Record
{
   int i;
   Record* next;
   Record* prev;
}Record;


I have over 5 trillions of records that I need to handle, now that I need to retrieve all of them and sort them out.
If its size was small, I could borrow stl's vector or list to do the job but now that it is too huge, I have no idea how to save the object data before sorting is performed

my function prototype

void sortRec(Record**recToSort,bool bASC){}
You should also have a look at External Sorting algorithms. This is another book on the subject Algorithms and Data Structures for External Memory