#include
typedef struct double_node {
int data;
struct double_node * next;
struct double_node * prev;
} d_node;
void static create(d_node ** head, int d) {
d_node *p = malloc(sizeof(d_node));
p->data = d;
if (*head == NULL) {
*head = p;//because of here needs **
(*head)->next = *head;
(*head)->prev = *head;
} else {
d_node *q = *head;
while (q->next != (*head)) {
q = q->next;
}
q->next = p;
p->next = *head;
p->prev = q;
(*head)->prev = p;