I have to clarify my question.
We have n operands and m operators. ( m < 5 )
  operands = {a,b,c,d}
  operators = {*, -, +, /}

We need to generate all of the the possibility permutations: (n * m
permutations)
For example: a+b-c*d

I think we will need to use Dynamic Programming.

I need to a program to generate above permutations.


On Mon, Nov 19, 2012 at 12:45 PM, Zinal Shah <[email protected]>wrote:

>
>
> On Mon, Nov 19, 2012 at 2:02 PM, Amir Hossein Sharifzadeh <
> [email protected]> wrote:
>
>> Hi
>>
>> We have n operands and m operators. For example:
>> operands = {a,b,c,d}
>> operators = {*, -, +, /}
>>
>> We must put operators between operands and create all of the
>> possibility permutations.
>> F1 = a+b+c+d
>> F2 = a+b+c-d
>> F2 = a+b-c-d
>> ....
>> Fi = a*b+c/d;
>>
>
> My Answer is:
>
> F1=a+b/c * d
>
>
>
>
>>
>>
>>  --
>>
>>
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to