Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Space/time tradeoff, but you don't have space...

by RMGir (Prior)
on Jun 19, 2002 at 16:26 UTC ( #175762=note: print w/ replies, xml ) Need Help??


in reply to Schwartzian Transform and memory allocation.

The ST is a space/time optimization, trading using extra space in order to save time.

Since you DON'T have the extra space, why not just eat the extra time and do the split in your comparison?

It might be worth benchmarking; it's going to be slower than ST or GRT would be, sure, but maybe it's tolerable for the data set sizes you're talking about. Sorting 759 items isn't THAT bad...

$ perl -e'for(1..759){push @x,rand}; @x=sort {$count++; $a <=> $b} @x; + print "$count\n"' 6783

--
Mike


Comment on Space/time tradeoff, but you don't have space...
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://175762]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (15)
As of 2015-07-28 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (258 votes), past polls