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_05,FREEMAIL_FROM, FREEMAIL_REPLYTO_END_DIGIT,INVALID_MSGID,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f32236e7e55b02e0,start X-Google-Attributes: gid103376,public From: "Joseph T." Subject: Ada Queue Date: 2000/04/06 Message-ID: <38eca724@news.hamilton.edu>#1/1 X-Deja-AN: 607582795 Sender: "Joseph T." X-Trace: 6 Apr 2000 11:03:00 -0500, 150.209.8.54 Reply-To: "Joseph T." Newsgroups: comp.lang.ada X-User-Info: 150.209.132.164 150.209.132.164 Date: 2000-04-06T00:00:00+00:00 List-Id: Can anyone corroborate why I chose to make this enqueue function using the passed pointer to Q instead of the temp pointer to loop through the queue? Any suggestions, ideas, compliments, critiques are greatly appreciated. Please help. procedure Enqueue(Q: in out Queue; E : Element_type) is New_Queue : Queue; begin if Q /= null then New_Queue := Q; while Q.Rest /= null loop Q := Q.Rest; end loop; Q.Rest := new QueueNode; Q := Q.Rest; Q.Data := E; Q.Rest := null; Q := New_Queue; else Q := new QueueNode; Q.Data := E; Q.Rest := null; end if; end Enqueue;