Quan Nguyen
Quan Nguyen

Reputation: 696

Vector or Synchronized LinkedList?Which is better to use?

I think this is very interesting topic. In your choice, then which is better between Vector or synchronized LinkedList?

Synchronized for LinkedList:

LinkedList linkedlist=new LinkedList();
List synchronizedlist= Collections.synchronizedList.(linkedlist);

Upvotes: 2

Views: 228

Answers (1)

Android Developer
Android Developer

Reputation: 466

The main difference is their implementation which causes different performance for different operations.

Vector is similar with ArrayList, but it is synchronized.

Syncronized LinkedList is implemented as a double linked list. Its performance on add and remove is better than Arraylist, but worse on get and set methods.

Upvotes: 1

Related Questions