mikec

0 Reputation

One Badge

15 years, 57 days

MaplePrimes Activity


These are replies submitted by mikec

For the second problem here is the timings: > f:=proc(k) if k=0 then return [] else return [k,f(k-1)] end if; end proc; f := proc(k) if k = 0 then return [] else return [k, f(k - 1)] end if end proc > A:=f(10000): > time(ListTools:-Flatten(A)); 1.910 > restart; bytes used=410457848, alloc=327620, time=3.92 > f:=proc(k) if k=0 then return [] els\ > e return [k,f(k-1)] end if; end proc; f := proc(k) if k = 0 then return [] else return [k, f(k - 1)] end if end proc > A:=f(10000): > time([seq(`if`(A=[], NULL, `+`(A[1], assign('A', A[2]))), i=1..10000)]); 18.230
Can you please provide a specific example of what you are trying to accomplish ? Thanks, Michael Cherkassoff, Maplesoft.
Page 1 of 1