java.util.LinkedList clear() improvement

Carsten Otto otto at informatik.rwth-aachen.de
Thu Aug 27 12:35:15 UTC 2009


On Thu, Aug 27, 2009 at 03:31:13PM +0300, Guy Korland wrote:
> It seems like linkedList.clear() can be easily fixed to O(1) instead of O(n).

With your solution one would be possible to continue working (traversing)
on an empty (read: emptied) list. I don't think this is desired.

Best regards,
-- 
Carsten Otto           otto at informatik.rwth-aachen.de
LuFG Informatik 2      http://verify.rwth-aachen.de/otto/
RWTH Aachen            phone: +49 241 80-21211
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20090827/e313b5e5/signature.asc>


More information about the core-libs-dev mailing list