Implementation of queue and stack in java.util.LinkedList

Mam told that in LinkedList, removeLast() is O(n)
But java.util.LinkedList is a doubly Linked List in which removeLast() too is O(1).

yes, the inbuilt linkedlist is is doubly linkedlist.
removeLast() will be of o1.

1 Like