🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2706

Re: STL and sorted disk based list

#2706
From: 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. ]
Technical Details
Message-ID: <01BAB8D2.4876D420@Cust51.Max1.Dallas.TX.MS.UU.NET>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 23 Nov 95 00:07:49 GMT
Approved: fjh@cs.mu.oz.au
Organization: -
Newsgroups: comp.std.c++
Message-ID: <01BAB8D2.4876D420@Cust51.Max1.Dallas.TX.MS.UU.NET>
From: Eugene Lazutkin <eugene@int.com>
Subject: Re: STL and sorted disk based list
X-Original-Date: Wed, 22 Nov 1995 12:01:38 -0600
Encoding: 26 TEXT, 50 UUENCODE
X-Ms-Attachment: WINMAIL.DAT 0 00-00-1980 00:00
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMLO7sOEDnX0m9pzZAQH6vwF6A2nqsSvB0iBV4yUdwwWM7ynr6nCbLtjk
 NPOo9rXSjVCkbchLeQWanJZHjWKoFYey
 =vbR1