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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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 10:12:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!freenix!enst!enst.fr!not-for-mail From: Michal Nowak Newsgroups: comp.lang.ada Subject: Re: Can someone help me understand this queue package? Date: Fri, 28 Dec 2001 19:16:22 +0100 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT X-Trace: avanie.enst.fr 1009563122 8464 137.194.161.2 (28 Dec 2001 18:12:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 28 Dec 2001 18:12:02 +0000 (UTC) To: "comp.lang.ada usegroup->mailing list gateway" Return-Path: In-reply-to: X-Mailer: Calypso Version 3.20.01.01 (3) Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk X-Reply-To: vinnie@inetia.pl List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:18362 Date: 2001-12-28T19:16:22+01:00 >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/ 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. >Looking at the pointers - is this some sort of linked list? Linked list may be implemented using pointers. >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. 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. 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? However, good luck and don't break down, -Mike