從有序鏈表L中刪除鏈表L本身所給位置上的節點。例如,如果L=(1 3 5 7 8),那麼刪除之後,L=(3 7)。

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);
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章