Skip to main content
4 events
when toggle format what by license comment
Aug 29, 2013 at 9:26 vote accept SadStudent
Aug 28, 2013 at 22:07 comment added Yuval Filmus As I mention, the first loop could be faster in principle (say if the magnitudes of the coefficient are very different), and in any case it only requires constant space.
Aug 28, 2013 at 21:43 comment added SadStudent but when you say "you can first run a loop that checks how many non-zero terms the result has", id does mean calculating the result twice , doesn't it?
Aug 28, 2013 at 21:13 history answered Yuval Filmus CC BY-SA 3.0