Velocity Reviews > Reverse polish

# Reverse polish

Steve Lambert
Guest
Posts: n/a

 12-19-2004
Hi

Anyone know how to convert a bracketed boolean expression into reverse
polish?

Cheers

Joona I Palaste
Guest
Posts: n/a

 12-19-2004
Steve Lambert <(E-Mail Removed)> scribbled the following:
> Hi

> Anyone know how to convert a bracketed boolean expression into reverse
> polish?

That's an algorithm question and better suited to comp.theory. I'd go
about it by parsing the expression into a tree and then appending its
nodes together in a depth-wise order.

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"Ice cream sales somehow cause drownings: both happen in summer."
- Antti Voipio & Arto Wikla

Guillaume
Guest
Posts: n/a

 12-19-2004
> That's an algorithm question and better suited to comp.theory.

Ditto.

You'll find what you need to get started in "Algorithms in C",
by Robert Sedgewick.

Keith Thompson
Guest
Posts: n/a

 12-19-2004
Joona I Palaste <(E-Mail Removed)> writes:
> Steve Lambert <(E-Mail Removed)> scribbled the following:
>> Hi

>
>> Anyone know how to convert a bracketed boolean expression into reverse
>> polish?

>
> That's an algorithm question and better suited to comp.theory.

Or comp.programming.

> I'd go about it by parsing the expression into a tree and then
> appending its nodes together in a depth-wise order.

Agreed.

--
Keith Thompson (The_Other_Keith) http://www.velocityreviews.com/forums/(E-Mail Removed) <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.

Steve Lambert
Guest
Posts: n/a

 12-19-2004
Thanks for the reply. Could you possibly expand on this slightly

"Joona I Palaste" <(E-Mail Removed)> wrote in message
news:cq4c8h\$i16\$(E-Mail Removed)...
> Steve Lambert <(E-Mail Removed)> scribbled the following:
>> Hi

>
>> Anyone know how to convert a bracketed boolean expression into reverse
>> polish?

>
> That's an algorithm question and better suited to comp.theory. I'd go
> about it by parsing the expression into a tree and then appending its
> nodes together in a depth-wise order.
>
> --
> /-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
> \-------------------------------------------------------- rules! --------/
> "Ice cream sales somehow cause drownings: both happen in summer."
> - Antti Voipio & Arto Wikla

Mark McIntyre
Guest
Posts: n/a

 12-19-2004
On Sun, 19 Dec 2004 21:53:25 GMT, in comp.lang.c , "Steve Lambert"
<(E-Mail Removed)> wrote:

>Thanks for the reply. Could you possibly expand on this slightly

If I might expand on it slightly, Joona rightly said you should ask this
over in comp.theory. I'd add comp.programming as a possible alternative.

Nobody is going to expand on the algo here. Its offtopic.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>

CBFalconer
Guest
Posts: n/a

 12-20-2004
*** rude topposting fixed ***

Steve Lambert wrote:
> "Joona I Palaste" <(E-Mail Removed)> wrote in message
>> Steve Lambert <(E-Mail Removed)> scribbled the following:
>>
>>> Anyone know how to convert a bracketed boolean expression into
>>> reverse polish?

>>
>> That's an algorithm question and better suited to comp.theory.

.... snip ...
>
> Thanks for the reply. Could you possibly expand on this slightly

Yes. You could also try comp.programming. c.l.c is for C language
questions and not for foolish toppposting.

--
Chuck F ((E-Mail Removed)) ((E-Mail Removed))
Available for consulting/temporary embedded and systems.

Malcolm
Guest
Posts: n/a

 12-21-2004

"Steve Lambert" <(E-Mail Removed)> wrote in message
newsLmxd.471\$(E-Mail Removed)...
> Thanks for the reply. Could you possibly expand on this slightly
>

Your problem is implementing an infix to reverse Polish algorithm. Once you
understand that, writing the code in C, Basic, or indeed any programming
language ought to be relatively striaghtforward. So it's not a comp.lang.c
question.

Steve Lambert
Guest
Posts: n/a

 12-29-2004
I realise this but comp.programming and comp.theory seem to be dead
newsgroups so I wasn't sure where else to post

"Malcolm" <(E-Mail Removed)> wrote in message
news:cqa06n\$8kj\$(E-Mail Removed)...
>
> "Steve Lambert" <(E-Mail Removed)> wrote in message
> newsLmxd.471\$(E-Mail Removed)...
>> Thanks for the reply. Could you possibly expand on this slightly
>>

> Your problem is implementing an infix to reverse Polish algorithm. Once
> you
> understand that, writing the code in C, Basic, or indeed any programming
> language ought to be relatively striaghtforward. So it's not a comp.lang.c
> question.
>
>

Joona I Palaste
Guest
Posts: n/a

 12-29-2004
Steve Lambert <(E-Mail Removed)> scribbled the following:
> I realise this but comp.programming and comp.theory seem to be dead
> newsgroups so I wasn't sure where else to post

should answer it here. We're not responsible for people on other
newsgroups.

--
/-- Joona Palaste ((E-Mail Removed)) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"To err is human. To really louse things up takes a computer."
- Anon