insertNode function
dynamic
insertNode(
- dynamic i,
- dynamic x,
- dynamic y,
- dynamic last,
Implementation
insertNode(i, x, y, last) {
var p = Node(i, x, y);
if (last == null) {
p.prev = p;
p.next = p;
} else {
p.next = last.next;
p.prev = last;
last.next.prev = p;
last.next = p;
}
return p;
}