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,FREEMAIL_FROM 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 06:51:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!newsfeed.mathworks.com!news.mathworks.com!uunet!nyc.uu.net!ash.uu.net!spool0900.news.uu.net!reader0900.news.uu.net!not-for-mail Date: Mon, 23 Sep 2002 09:53:22 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Beginer problem: variable array size References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1032789075.864322@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@mosquito.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1032789077 reader0.ash.ops.us.uu.net 5776 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:29279 Date: 2002-09-23T09:53:22-04:00 List-Id: tmoran@acm.org wrote: > using > List : array(1 .. 8*3600) of Integer; > and a better than quadratic sort is probably much simpler and more > reasonable than a (pretend) "no limit". In modern computing environments, programs that take input from the user are easily hooked up to take input from other programs or files instead, so working on the assumption that the program will be used only by a human typist is foolish. 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. 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. I suppose you could just range over the size of the array and ignore any extra input. This is exactly the kind of silently wrong behavior I was talking about. And further yet, why do you think you get to rewrite the given requirements just because they don't suit the style of your favorite programming language?