# Minimize amount of evaluations with fold/table/thread or something else

I can't figure out how to use fold/table/map/distribute or whatever to get this:

{f[f[{},a],a],f[f[{},a],b],f[f[{},a],c],f[f[{},a],d],f[f[{},a],e],
f[f[{},b],a],f[f[{},b],b],f[f[{},b],c],f[f[{},b],d],f[f[{},b],e],
f[f[{},c],a],f[f[{},c],b],f[f[{},c],c],f[f[{},c],d],f[f[{},c],e],
f[f[{},d],a],f[f[{},d],b],f[f[{},d],c],f[f[{},d],d],f[f[{},d],e],
f[f[{},e],a],f[f[{},e],b],f[f[{},e],c],f[f[{},e],d],f[f[{},e],e]}


That is I need to evalute f[{},n] n=a,...,e. For each result I need do the same again and again. So total evaluations for i iterations should be:

Sum[Power[5,n],{n,i}]

-

L = {a,b,c,d,e};
f @@@ Tuples@{f[{},#]&/@L, L}


does 5 + 25 evaluations and gives

{f[f[{},a],a],f[f[{},a],b],f[f[{},a],c],f[f[{},a],d],f[f[{},a],e],
f[f[{},b],a],f[f[{},b],b],f[f[{},b],c],f[f[{},b],d],f[f[{},b],e],
f[f[{},c],a],f[f[{},c],b],f[f[{},c],c],f[f[{},c],d],f[f[{},c],e],
f[f[{},d],a],f[f[{},d],b],f[f[{},d],c],f[f[{},d],d],f[f[{},d],e],
f[f[{},e],a],f[f[{},e],b],f[f[{},e],c],f[f[{},e],d],f[f[{},e],e]}

-
Nest[f @@@ Tuples@{#, L} &, f[{}, #] & /@ L, i - 1] is 30% faster than my own code thank you :D – Coolwater Nov 30 '13 at 9:14
Nest[f @@@ Tuples@{#, test} &, {{}}, i] even better – Coolwater Nov 30 '13 at 9:20