home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / pascal / 7900 < prev    next >
Encoding:
Internet Message Format  |  1993-01-06  |  1.9 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!asuvax!ennews!telesys!wierius!witsend!dcs
  2. Message-ID: <765349d6649994t242@witsend.uucp>
  3. Date: Tuesday, 5 January 1993 18:27:42 MST
  4. X-Mailer: TMail version 1.15R
  5. From: "D. C. Sessions" <dcs@witsend.tnet.com>
  6. Organization: Nobody but me -- really
  7. References: <1993Jan3.222248.18162@news.acns.nwu.edu>
  8. Subject: Re: LARGE Sorts and such...
  9. Newsgroups: comp.lang.pascal
  10. Distribution: world
  11. Lines: 23
  12.  
  13. In <1993Jan3.222248.18162@news.acns.nwu.edu>, delusion@casbah.acns.nwu.edu (Albert Schmezer)  wrote:
  14. #     Anyways, for the question: How does one go about, in TurboPascal,
  15. # sorting an array of IMMENSE proportions? What I mean is that I am making a
  16. # database-type program, and I have at least 10,000 items in the database. How
  17. # can I sort 10,000 items? They won't even fit into an array! If I can't sort
  18. # them, how can I at least index them? I really need the ability to sort these
  19. # LARGE amounts of information. If it were only 500 or even 1000 entries, it
  20. # wouldn't be a problem - I would use a Quicksort or Heapsort routine, but
  21. # 10,000 or 100,000 presents a grave problem. Is there a way to make use of a
  22. # temporary file on the harddrive? How slow is this? How would I even go about
  23. # doing this? Can I stick groups of 100 or so into an array and integrate the
  24. # sorts? How would I do this?! Is this slow, too?
  25.  
  26.   Well, you COULD use a linked list instead of an array to collect your
  27.   data.  That way, your main limitation would be the amount of memory
  28.   available to hold the keys.  I know that Quicksort is very popular, but
  29.   Mergesort actually has better worst-case performance and works very
  30.   well on linked lists.
  31.  
  32. --- D. C. Sessions                            Speaking for myself ---
  33. --- Note new network address:                dcs@witsend.tnet.com ---
  34. --- Author (and everything else!) of TMail  (DOS mail/news shell) ---
  35.