Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Challenge: Sorting Sums Of Sorted Series

by JavaFan (Canon)
on Feb 03, 2010 at 23:57 UTC ( [id://821288]=note: print w/replies, xml ) Need Help??


in reply to Challenge: Sorting Sums Of Sorted Series

The challenge then is that memory consumption needs to be less than N + M + N*M where N and M represent the number of elements in the respective lists.
That's N + M + N * M of what? Since you aren't writing it as a big-O notation (in which case, it's fairly trivial, as any naive implementation doesn't need more memory than O(N*M), and cannot use less as that's the size of the output list), you should mention the units you mean. Considering that N + M is the size of the input, and N * M the size of the output, it means that if the unit is "values", there isn't room for a single iterator.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-19 21:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found