3.10
8從有序鏈表L中刪除鏈表L本身所給位置上的節點。例如,如果L=(1 3 5 7 8),那麼刪除之後,L=(3 7)。
void delete_itself(List la) {
cout << "Please input the number of place: " << endl;
int n;
cin >> n;
int *a = new int[n];
cout << "Please input the value of place: " << endl;
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
List pa;
int temp, j=0;
pa = la;
while (j!=n)
{
temp = a[j];
Spec_Delete(pa, temp);
j++;
}
find_List(pa);
//outputlist(pa);
}