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