Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ArrayList and LinkedList  RSS feed

 
Tom Tang
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the difference between ArrayList and LinkedList? If we don't care about speed, it seems to me that LinkedList can replace Arraylist anywhere. Is it also true vice versa? What standard can we use when deciding to use ArrayList or LinkedList?
 
George Toronto
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my view, the different points are the following:
1)Positional access has constant time performance in ArrayList and VEctor, but linear time in LinkedList.
2)in most cases the primary implementation ArrayList is the best choice for implementing listd. Where frequent insertions and deletions occur inside a list, a LinkedList can be worth considering.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!