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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cae702701e24ef29 X-Google-Attributes: gid103376,public From: nospam@somewhere.ia.us (Robert S. White) Subject: Re: Please read this..thank you Date: 1997/11/02 Message-ID: <63ihp7$pq2$1@flood.weeg.uiowa.edu>#1/1 X-Deja-AN: 287414423 References: <345BBEC0.1D12@upnaway.com> Organization: designing/implementing avionics during the day Newsgroups: comp.lang.ada Date: 1997-11-02T00:00:00+00:00 List-Id: In article <345BBEC0.1D12@upnaway.com>, Sho@upnaway.com says... > >Dear Ada Programmers, > >Could you please help me with the algorithms on how to convert Infix to >a Postfix expression? examples: > >Infix: 1 + 2 + 3 >Postfix: 1 2 3 + + The most common technique (for this very old homework problem) is to push operations up on one stack and data up on another while examining the precedence of the must recently pushed operation with the newest encountered operation - and immediately doing the operation if appropriate. I remember helping people with their Pascal homework on this type of problem in the early 80's. I hope you can take this general approach and flesh it out to code the solution to your problem. >If anyone has done a program that converts infix to postfix could you >please help me via email or newsgroup? We really should not do this - although I am sure that I have seen such programs in learning to program books. For example check out Michael Feldman's book "Ada 95 Problem Solving and Program Design" in chapter 14.6 Problem Solving: Stacks and Queues around page 683 he has an example, CHECKING FOR BALANCED PARANTHESES, which uses stacks that should give you some clues and useful code snippets. Thank you for your time and >consideration.^_^ Good luck, work hard, and have fun :-) _____________________________________________________________________ Robert S. White -- An embedded systems software engineer e-mail reply to reverse of: ia us lib cedar-rapids crpl shift2 whiter