🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Eugene Lazutkin Thu, 23 Nov 1995 00:07
Re: STL and sorted disk based list
#2706
Author: Eugene Lazutkin
Date: Thu, 23 Nov 1995 00:07
34 lines
2146 bytes
: In article <48h0vg$8i6@meg.tesser.com> ralphs@tesser.com (Ralph Shnelvar)
: writes:

: > I haven't even peeked at the STL but am wondering if there is support
: > for a disk based sorting and/or indexing algorithms.
: > 
: > That is, is there support for sorting monster arrays.

You can define appropriate iterators for you disk-based data.  After
that you can use QuickSort. :-)  I think it doesn't solve your problem
from the practical point of view.

If you are going to sort a huge array of disk-based data, you should
use something like balanced multiway merge with presorted sequences.
You have to deal with the allocation and the maintanance of temporary
storage.  You have to combine memory-based sorting algorithm with
disk-based.  You have to choose the "right" strategy for that.

STL doesn't support these things directly. One of possible solutions:
define special algorithm for such task, implement your own container,
solve the problem of additional storage maintanence (necessary for
multiway merge), pick up the good strategy of combination of different
approaches (or how to give a hint for your sorting algorithm about the
choosing of such strategy).

STL doesn't solve all programer's problems. We have to face it.  But it
defines the good foundation for good programming.

Eugene Lazutkin eugene@int.com

---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation
  policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads