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-Thread: 103376,b150dc5817cc056a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 04 Nov 2005 21:33:43 -0600 From: "Steve" Newsgroups: comp.lang.ada References: <1131120135.758294.294990@o13g2000cwo.googlegroups.com> <873bmcv0vs.fsf@willow.rfc1149.net> <1131121827.249591.288510@g14g2000cwa.googlegroups.com> Subject: Re: Desperatly trying to implement an mergesort algorithm Date: Fri, 4 Nov 2005 19:33:53 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 24.20.111.245 X-Trace: sv3-DjqC01Qf375sJ0yX1WEoXL90AVfeuhwNylvbR46itqqqI4bHPL8f0VLbwGetkVQpw4Q7dHQkmfnQM+5!t4///aiOLcgUhx4UBzsbxyn69X5d5aaRel+9vXvwJLVDNcYfpXFZXQ4P81RtBVOQD1Vq0Ysm/JUp X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:6224 Date: 2005-11-04T19:33:53-08:00 List-Id: wrote in message news:1131121827.249591.288510@g14g2000cwa.googlegroups.com... > Does the partitioning look proper? With me using A'first and A'last? > > mergesort(A(A'first .. middle)); > mergesort(A(middle+1 .. A'last)); > The partitioning looks right to me. Now a few questions: What is left_list for? (looks like it could be deleted) What is right_list for? (looks like it could be deleted) In the while loop that does the merging, the smallest value of elements i and j are added sortarr, until one of the halves of the sublists is exhausted. What happens to the remaining elements? That's not your biggest problem: Hint: If you change the procedure to procedure Mergesort(A: List) ... Your code will still compile. Steve (The Duck)