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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d142408257dde54c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-28 15:02:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!tank.news.pipex.net!pipex!newspeer.clara.net!news.clara.net!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail Reply-To: "Liddle Feesh" From: "Liddle Feesh" Newsgroups: comp.lang.ada References: Subject: Re: Can someone help me understand this queue package? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Fri, 28 Dec 2001 22:57:23 -0000 NNTP-Posting-Host: 213.105.185.39 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 1009580245 213.105.185.39 (Fri, 28 Dec 2001 22:57:25 GMT) NNTP-Posting-Date: Fri, 28 Dec 2001 22:57:25 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:18370 Date: 2001-12-28T22:57:23+00:00 List-Id: "Michal Nowak" wrote: > >Essentially, I have a spec, and I'm trying my damndest to write a body for > >it - and though I've tried (hence my previous two posts here), I'm still > >quite stuck, with only a very basic stub compiling. > > > >Does anyone have any decent queue tutorials? I've tried looking for a few > >on > >the net - adapower, an ada program (console), and several books... However > >when it comes to queues I'm none-the-wiser... > > Look at John English's book "ADA 95: THE CRAFT OF OBJECT-ORIENTED PROGRAMMING" > at: http://www.it.bton.ac.uk/staff/je/adacraft/ I'll give it a shot - esp as it's online, and I won't have to take it out of the library. > Part Two - abstract data types is what you should read. Just drop writting code > for the moment, relax and read it carefully. Athough there is example about > a list, you should have trouble write a spec for your queue. If you are in big > hurry, start from chapter 11. > > You may look also at: > http://burks.bton.ac.uk/burks/language/ada/ > "Object Oriented Software in Ada 95 Second Edition", > by Michael Smith. I'll do that one too ;) > >Looking at the pointers - is this some sort of linked list? > > Linked list may be implemented using pointers. True - but with reference to the spec - some sort of linked list? > >Could someone be so kind as to convert the following package into > >pseudo-code for me? > > No :-)). > Solution 1. > Treat a queue as a simple list (you may abandon Iterators idea for > simplicity), with operations Add and Remove. > Add is something like Insert at beginning, > and Remove is like delete at the end. Will do... What is Iterators idea? > Solution 2. > Take paper, pencil and draw what is happening with pointers (access > types) during addition and removal (such as on pictures in chapter 11). > Than implement it. Yes, but what >IS< happening with pointers? I'll have a go. > BTW it looks like a homework or something. Do you want to stay with Ada > for a longer time, or just write the program, pass the subject, and forget? I like the principals of ADA - it'll probably be something I'll stick with and have to learn. I'm trying to read it as part of my degree; of course ADA is quite a good skill to learn; esp. with the industries in my local area. > However, good luck and don't break down, I think I'm about to cry... -- Liddle Feesh ' O 0 o <"//>< ' o'^ (Remove UNDERPANTS to reply)