Multiplying positive integers - smaller ones first?

41 Views Asked by At

Suppose that we want to multiply following integers.

2, 3, 4, 5, 6, 1092380294750349875094810257491

It is clear that

(((((2*3)*4)*5)*6)*1092380294750349875094810257491) method is faster then

(((((1092380294750349875094810257491*6)*5)*4)*3)*2) method.

My mind tell me that "Multiply small integers first, large integers later.. it's a common sense"

But I am not sure whether such logic can be applied to arbitrary list of integers.

Can you teach about this?