MCPcopy Create free account
hub / github.com/microsoft/SandDance / insertNode

Function insertNode

docs/app/js/sanddance-app.js:102092–102104  ·  view source on GitHub ↗
(i, x, y, last)

Source from the content-addressed store, hash-verified

102090 return b2;
102091}
102092function insertNode(i, x, y, last) {
102093 const p = new Node(i, x, y);
102094 if (!last) {
102095 p.prev = p;
102096 p.next = p;
102097 } else {
102098 p.next = last.next;
102099 p.prev = last;
102100 last.next.prev = p;
102101 last.next = p;
102102 }
102103 return p;
102104}
102105function removeNode(p) {
102106 p.next.prev = p.prev;
102107 p.prev.next = p.next;

Callers 1

linkedListFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected