دوستان من دارم یه برنامه می نویستم کهبا استفاده از لیست دو پیوندی عملیات مرتب سازی درجی (insertion Sort ) رو انجام بده . یه منو هم داشته باشه که 1 - افزودن به گره 2 - جستجوی یک گره 3 - نمایش لیستی از گره های موجود 4 - حذف گره در صورت وجود 5 - خروج از برنامه

تا اینجاشو خودم نوشتم بگین اشکالی داره یا نه


vodi main()
{
int d;
int c;
while(1)
{
cout<<"1)insert\n";
cout<<"2)remove\n";
cout<<"3)search\n";
cout<<"4)list\n";
cout<<"5)exite\n";
cout<<"enter your chioce";
cin>>c;
switch(c)
{
case 1 :
newi=(struct Dlist*)malloc(size of(struct DLlist);
insert();
break;
case 2 :
cout<<enter your datafield value:';
cin>>d;
remove(d);
break;
Case 3 :
cout<<"enter your value :";
cin>>d;
search(d);
break;
Case 4 :
list()
break;
Case 5 :return;
default:cout<<wrong Choise";
}
}
}



void insertionsort ( int s[] , int n)
{
int i , j , x;
for (i=1 ; i>=n ; i++)
{
x = s [i];
j= i-1;
while( j>0 && s [j] > x)
{
s[j+1] = s [j];
j--;
}
s[j+1]=x;
}
}


int binarySearch(int s[], int n)
{
if(!head)
return (-1);

struct llis*temp=head;
while(temp)
{
if (temp--> data=d)
return(1);
temp=temp-->next;
}
return(0);
}

//end