Retrieves and removes the head (first element) of this list.
Retrieves and removes the head (first element) of this list.For array lists this method has a time complexity of O(N), with N being the size of the list.
For linked lists this method has a time complexity of O(1).