index.js
function insertNode(p, prev) {
    var node = {
        p: p,
        prev: null,
        next: null,
        minX: 0,
        minY: 0,
        maxX: 0,
        maxY: 0
    };

    if (!prev) {
        node.prev = node;
        node.next = node;

    } else {
        node.next = prev.next;
        node.prev = prev;
        prev.next.prev = node;
        prev.next = node;
    }
    return node;
}
function insertNode(p, prev) {
    var node = {
        p: p,
        prev: null,
        next: null,
        minX: 0,
        minY: 0,
        maxX: 0,
        maxY: 0
    };

    if (!prev) {
        node.prev = node;
        node.next = node;

    } else {
        node.next = prev.next;
        node.prev = prev;
        prev.next.prev = node;
        prev.next = node;
    }
    return node;
}
function insertNode ( p , prev ) { var node = { p : p , prev : null , next : null , minX : 0 , minY : 0 , maxX : 0 , maxY : 0 } ; if ( ! prev ) { node . prev = node ; node . next = node ; } else { node . next = prev . next ; node . prev = prev ; prev . next . prev = node ; prev . next = node ; } return node ; }
create a new node in a doubly linked list
create a new node in a doubly linked list