Question: I am trying to to understand **why Java's ArrayDeque is better than Java's LinkedList** as they both implement Deque interface. 

I hardly see someone using ArrayDeque in their code. If someone sheds more light into how ArrayDeque is implemented, it would be helpful. 

If I understand it, I will be more confident using it. I could not clearly understand the JDK implementation as to the way it manages head and tail references.

Answer: 
I don't think `ArrayDeque` is better than `LinkedList`. They are different.

`ArrayDeque` is faster than `LinkedList` on average. But for adding an element, `ArrayDeque` takes amortized constant time, and `LinkedList` takes constant time.

For time-sensitive applications that require all operations to take constant time, only `LinkedList` should be used.

`ArrayDeque`'s implementation uses arrays and requires resizing, and occasionally, when the array is full and needs to add an element, it will take linear time to resize, resulting the `add()` method taking linear time. That could be a disaster if the application is very time-sensitive.

A more detailed explanation of Java's implementation of the two data structures is available in the "[Algorithms, Part I](https://www.coursera.org/learn/algorithms-part1)" course on Coursera offered by Princeton University, taught by Wayne and Sedgewick. The course is free to the public.

The details are explained in the video "Resizing Arrays" in the "Stacks and Queues" section of "Week 2".
Time complexity for ArrayDeque for accessing a element is O(1) and that for LinkList is is O(N) to access last element. ArrayDeque is not thread safe so manually synchronization is necessary so that you can access it through multiple threads and so they they are faster.