双向链表,大家能帮小弟我看看有什么有关问题吗,还有什么可以改进的

双向链表,大家能帮我看看有什么问题吗,还有什么可以改进的
   好久没写链表了,今天写了个双向链表,不知道自己写得怎样,也不知道有什么潜在的问题,求各位指教,插入暂时还没写,插入跟删除差不多就不写了。
代码如下:
#include <iostream>
using namespace std;
typedef int ElmType;
const int length=10;

typedef struct node
{
ElmType i;
struct node* next;
struct node* back;
}Node;

void init(Node*&,int);  //初始化双链表
bool traverse(Node*);  //前后遍历双链表
void insert(Node*&);    //在节点p后插入
void del(Node*&);      //删除节点p
void collect_space(Node* head);

void main()
{
Node *head,*p;  //生成一个未初始化的Node类型头指针
init(head,length);//建立双向链表,其中包括初始化head指针
p=head->next->next;
del(p);  //删除节点p
traverse(head); //遍历
getchar(); //按任意键退出
collect_space(head);  //收回链表空间
}

void init(Node* &head,int max_num)
{
    head=(Node*)malloc(sizeof(Node));
head->i=0;
head->back=NULL;
head->next=NULL;
Node *p,*temp;
p=head;
for(int i=1;i<max_num;i++)
{
temp=(Node*)malloc(sizeof(Node));
temp->i=i;
temp->back=p;
temp->next=NULL;
p->next=temp;
p=temp;
}
}

bool traverse(Node* head)
{
if(head==NULL)
{
cout<<"输入的head为空"<<endl;
return false;
}
while(head!=NULL)
{
cout<<head->i<<"  ";
head=head->next;
}
return true;
}

void del(Node* &p)
{
if(p==NULL)
{
cout<<"你输入的指针为空"<<endl;
return;
}
Node *temp=p;
if(p->next==NULL)
{
//如果删除的是尾指针,那么删除p后,p所指向位置自动前移一位
if(p->back==NULL)
{
cout<<endl<<"链表已清空"<<endl;
free(p);
p=NULL;
return;
}
else
{
   p=temp->back;
   p->next=NULL;
   free(temp);
}
}
else if(p->back==NULL)
{
//如果删除的是头指针,那么删除p后,p所指向位置向后移一位
p=temp->next;
p->back=NULL;
free(temp);
}
else
{
//如果删除的是中间位置的,那么删除p后,p指向位置向前移一位
p=temp->next;
temp->back->next=p;
p->back=temp->back;
free(temp);
}
}

void insert(Node* &p)
{

}

void collect_space(Node* head)
{
   while(head!=NULL)
   {
   del(head);
   }
}

先谢谢大家了

------解决方案--------------------
双向链表的建立 
// * ======================================== */
// *    程式实例: 4_3_1.c                   */
// *    双向链结串列的建立                    */
// * ======================================== */
#include <stdlib.h>

struct dlist                      // * 双向串列结构宣告   */
{
   int data;                      // * 节点资料           */