From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,71c743c03ed191fe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-23 10:14:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed-west.nntpserver.com!hub1.meganetnews.com!nntpserver.com!telocity-west!TELOCITY!sn-xit-03!sn-xit-01!sn-xit-04!sn-xit-08!supernews.com!12.120.28.37.MISMATCH!attla2!ip.att.net!attbi_feed3!attbi_feed4!attbi.com!sccrnsc02.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Beginer problem: variable array size References: <1032789075.864322@master.nyc.kbcfp.com> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc02 1032800994 12.234.13.56 (Mon, 23 Sep 2002 17:09:54 GMT) NNTP-Posting-Date: Mon, 23 Sep 2002 17:09:54 GMT Organization: AT&T Broadband Date: Mon, 23 Sep 2002 17:09:55 GMT Xref: archiver1.google.com comp.lang.ada:29289 Date: 2002-09-23T17:09:55+00:00 List-Id: > The professor probably has files of input numbers that will > be fed to each submitted program. I'll bet one of them is > very large, to test the input size limit even if the sort > won't complete in a reasonable amount of time. I'd be very interested in seeing an answer to the OP problem that had no limit on the number of inputs. I'd even be interested in a version that would run with a very large number, say 6E23, of inputs. Would it use all the machines on the internet to store input? I fear even that wouldn't be enough. If you can't show such a program, then I'd like to know what in fact are its limits, either as a constant like 8*3600 or 10_000_000 or by a formula like "System_RAM_In_Bytes/2" or some such thing. > Furthermore, if you are going to have an arbitrary limit, > you have to provide the extra code to handle the case of > the limit being exceeded. Not for an introductory class. And for a more advanced class, I suspect a "raised Storage_Error" message, or taking a year to run, wouldn't receive a very high grade. > And further yet, why do you think you get to rewrite the > given requirements just because they don't suit the style of The OP problem spec was incomplete. Given that it followed a Hello World program, I suspect it came early in a programming class and the prof would be happy with a quadratic sort and would test it with a few tens at most of inputs. If it was my homework, I'd include a statement of that assumption and why I made it. If the assignment came up in an advanced class after the prof had been describing a space probe crashing into the sun, collecting a measurement every 50 nanoseconds for one half second, then sorting and transmitting those 10 million measurements in the remaining half second before meltdown, I would make different assumptions, document them, and write the program a different way. It's bad to make foolishly limiting assumptions, but worse to depend on undocumented assumptions. Just the act of documenting them may encourage a programmer to Think! and make better assumptions.