pull method

T? pull()

Get the top item and remove it

Implementation

T? pull() {
  if (isEmpty()) return null;
  T returnValue = head!.value;
  head = head!.previous;
  return returnValue;
}