POV-Ray : Newsgroups : povray.off-topic : Trolltech doesn't know how amortized time works : Re: Trolltech doesn't know how amortized time works Server Time
4 Sep 2024 21:23:49 EDT (-0400)
  Re: Trolltech doesn't know how amortized time works  
From: Darren New
Date: 2 Nov 2009 18:01:36
Message: <4aef64d0@news.povray.org>
clipka wrote:
> Of course if someone only considers the cost of insertion, neglecting 
> any other costs his algorithm may incur, he's doin' it wrong...

Trolltech gets the numbers wrong even if you insert always at the end. 
Amortized O(1) append is only O(1) if you double the size of the array each 
time you insert something. It's not O(1) if you add a fixed size to the 
array each time (assuming you're copying elements from the old array to the 
new array each time, of course).

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.