TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ROSE
from: CAMERON CLARK
date: 1997-11-15 14:10:00
subject: Re: Postfix/Infix

R> Convert these postfix to infix:
R> ABCD-/+
R> AB-C/D+
R> AX+Y+UV-/
R> AX+Y+U/V-
R> 
R> 
R> Convert these infix to postfix:
R> A*(S+Y/W)/(U-V) 
R> A-B-C+W 
R> A*(B-Y-X-E)/(F+G)
R> A-B/C-D*E/F/G
    
    One common answer is to use a recursive decent parser to build
    an expression tree.
    Another method is to use an operator precedence table and a stack
    to convert.
    Both methods are a bit complex and require either a pre-exsisting
    stack or unsorted binary tree.
--- GEcho 1.00
---------------
* Origin: Digital OnLine Magazine! - (409)838-8237 (1:3811/350)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.