Q:

What is the algorithmic runtime of the removeFirst() method in a LinkedList?

Ok, so I know there exist some really good threads about the cost of different operations on the Collection interface. When to use LinkedList<> over ArrayList<>? gives a great overview of the difference between ArrayList and LinkedList. But after reading that thread I am still unsure of one thing:
Is the algorithmic runtime of removeFirst()/pollFirst() and removeLast()/pollLast() O(1) or do i have to use an Iterator to achieve this?

A:

If you refer to the javadoc:

All of the operations perform as could be expected for a doubly-linked list.

So removal of the head or tail is O(1).

