Этот код используется для enqueue на входном конце:
enqueue
Vertex vtx = new Vertex(v) vtx.next = head if (head != null) head.prev = temp head = vtx