LebGeeks

A community for technology geeks in Lebanon.

You are not logged in.

#1 October 13 2010

arithma
Member

Exercise - Polish Calculator Extra

http://www.lebgeeks.com/forums/viewtopic.php?id=7560
Addendum:
Given a specific desired result, and a list of operations and numbers, order the operations and numbers so that the computation will match the result.

History: I succesfully implemented this to win a competition on tv where you are given numbers and operators to match a result, but was too satisfied when it worked to care to participate in the competition.

[edit]
Example:

result: 15
operations: + *
1 2 5

The algorithm should return: 1 2 + 5 *
result: 30
operations: * * * /
2 5 10 3 10

Possible return: 2 5 * 10 / 3 * 10 *

I need someone to double check my polish calculations!

Last edited by arithma (October 13 2010)

Offline

#2 October 13 2010

Joe
Member

Re: Exercise - Polish Calculator Extra

I confirm the Polish calculation.

Good exercise ^^

Offline

#3 October 13 2010

Padre
Member

Re: Exercise - Polish Calculator Extra

is brute force considered an approach ?

Offline

Board footer