insertBefore method
Implementation
VertexList insertBefore(VertexNode target, VertexNode vertex) {
vertex.prev = target.prev;
vertex.next = target;
if (vertex.prev == null) {
head = vertex;
} else {
vertex.prev!.next = vertex;
}
target.prev = vertex;
return this;
}