123456789
node *ptr = new node; ptr->value = x; node *toinsert; if (!head) { head = ptr; head->prenode = head->nextnode = head; } else