struct node { int data; struct node *next; struct node *prev; }; struct node *start = NULL; // pointer to start of list. struct node *end = NULL; // pointer to end of list struct node * create (data) int data; { struct node *temp = (struct node *)malloc(sizeof(struct node)); temp->data = data; temp->next = temp->prev = NULL; return temp; } struct node * push(start, temp) struct node *start; struct node *temp; { if(start == NULL) { // this node is the first node, assign it as is. start = temp; } else { temp->next = start; start->prev = temp; start = temp; } return start; }