On 04 Dec 2001 02:20:19AM -0600, Michael Chaney ([EMAIL PROTECTED]) said:

> The biggest problem that I see is that "9 9 + 9 +" is identical to
> "9 9 9 + +", "9 9 9 + *" is identical to "9 9 9 * +", etc. so there is
> room for optimization.  Ultimately, it would probably make sense to run
> your output through another program to determine which in the list are

Hehehe. No need to determine - just evaluate each expression and sort.
;)

Pipes are our friends.

> for a bunch of 9's and operators, and ultimately it's probably the
> same as the number of combinations of operators and parenthetical

Actually, hmmm.. you're right, there's a nuance I think I've missed. Is
permutation called for, or can we assume that all 9s end up at the left?
I've a sinking feeling that the former is the case, but I'd like to be
proven wrong. If so, that raises the complexity a notch, but postfix
does tend to make it easier - just generate unique permutations, I
suppose.

What's the total count of possible expressions?

> placement for solving it in infix notation.  The point, which I've now
> made a few times but will again, is that the code to do it postfix style
> is much simpler since it has less work to do.

Well, actually, it's also much easier to conceptualize - but then again,
that's probably just me and my inherent dislike of anything involving
subsets... ;)
-- 
Sacha Chua <[EMAIL PROTECTED]>                       3 BS CS geek =)
Ateneo Cervini-Eliazo Networks (ACENT) tel: 63(2) 426-6001 loc 5925
BOFH excuse #288: Hard drive sleeping. Let it wake up on it's own...
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to