clear « LinkedList « Java Collection Q&A

Home
Java Collection Q&A
1.algorithm
2.array
3.Array Byte
4.Array Char
5.Array Convert
6.Array Dimension
7.Array Integer
8.Array Object
9.Array String
10.ArrayList
11.collection
12.comparator
13.Development
14.Garbage Collection
15.Generic
16.hash
17.HashMap
18.HashTable
19.iterator
20.LinkedList
21.List
22.Map
23.queue
24.Set
25.Sort
26.tree
Java Collection Q&A » LinkedList » clear 

1. clear() impl in Java's LinkedList    stackoverflow.com

I fear this is a really stupid question, but here goes: Why does the clear method in Java's default LinkedList implementation bother to walk the list and unhook all the nodes? ...

2. Why isn't LinkedList.Clear() O(1)    stackoverflow.com

I was assuming LinkedList.Clear() was O(1) on a project I'm working on, as I used a LinkedList to drain a BlockingQueue in my consumer that needs high throughput, clearing and reusing ...

3. LinkedList Clear    forums.oracle.com

I'm doing a homework assignment for class. I'm stuck on clearing the entire LinkedList. I know I could just use the remove method in my ListIterator and through a loop or two remove the nodes. However this doesn't seem very efficient. I'm curious if I simply set head and tail to null, would this isolate the nodes and tell garbage collector ...

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.