abhijitg ga wrote:Creation : Arraylist if faster to create than linkedlist.
abhijitg ga wrote:Insertion: Arraylist is slower when inserting objects in the list especially towards the beginning of the list. Linkedlist is much faster than Arraylist for insertion.
abhijitg ga wrote:access : Arraylist is faster to access than linkedlist.
abhijitg ga wrote:But can you confirm that LinkedHashSet scores over arraylist and linkedlist in terms of creation, Insertion ( hashsets uses hashing so I guess insertion should be faster) , access ( again due to hashing access should be fast) ???
abhijitg ga wrote:Hello,
Creation : Arraylist if faster to create than linkedlist.
Insertion: Arraylist is slower when inserting objects in the list especially towards the beginning of the list. Linkedlist is much faster than Arraylist for insertion.
access : Arraylist is faster to access than linkedlist.
But can you confirm that LinkedHashSet scores over arraylist and linkedlist in terms of creation, Insertion
Jesper de Jong wrote:
abhijitg ga wrote:Creation : Arraylist if faster to create than linkedlist.
That completely depends on the implementation of the ArrayList and LinkedList classes. There's no reason to assume that creating an ArrayList would be faster than creating a LinkedList.
abhijitg ga wrote:See the sample program by Stephan van Hulst at this link : https://coderanch.com/t/370191/java/java/Difference-between-ArrayList-LinkedList. Arraylist is faster to create than linkedlist
Insertion: Arraylist is slower when inserting objects in the list especially towards the beginning of the list. Linkedlist is much faster than Arraylist for insertion.
abhijitg ga wrote:access : Arraylist is faster to access than linkedlist.
abhijitg ga wrote:But can you confirm that LinkedHashSet scores over arraylist and linkedlist in terms of creation, Insertion ( hashsets uses hashing so I guess insertion should be faster) , access ( again due to hashing access should be fast) ???
abhijitg ga wrote:if checking if element is fast (I assume that it uses the hashing to check whether the element exists ) then accessing the same element should also be fast? Or I am missing some difference between accessing an element and checking if the element exists?
If you're gonna buy things, buy this thing and I get a fat kickback:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
|