Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Linked lists as arrays: inserting values

by jdporter (Canon)
on Sep 25, 2006 at 21:50 UTC ( #574837=note: print w/ replies, xml ) Need Help??


in reply to Linked lists as arrays: inserting values

Does your application actually require random-access insertion at any point in the array? If not, there are some optimization techniques you can try...

We're building the house of the future together.


Comment on Re: Linked lists as arrays: inserting values
Re^2: Linked lists as arrays: inserting values
by radiantmatrix (Parson) on Sep 25, 2006 at 22:58 UTC

      I should have said heuristics, rather than optimizations. For example, if the point of the next insertion is usually "very close" to the previous insertion, you can make a significant improvement in the performance (e.g. O(n) vs O(n log n)). At any rate, choosing a O(n) algorithm up front instead of a O(n log n) algorithm shouldn't be dismissed as "premature". It could be, in fact, a well-timed optimization of your development process. :-)

      We're building the house of the future together.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2014-07-26 17:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (178 votes), past polls