Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. void delNodo(const T nodo) {
  2.         #ifdef NDEBUG
  3.     std::cout << ">DelNodo(nodo)" << std::endl;
  4.     #endif
  5.         int target = exist(nodo);
  6.         if (target >= 0) {
  7.             Grafo<T,Eql> tmp(_size - 1);
  8.             for(int i = 0,x = 0; i < NumNodi();i++)
  9.                 if (i != target) {
  10.                     tmp.nodi[x]=nodi[i];
  11.                     for (int j = 0, y = 0; NumNodi() < 3; j++) {
  12.                         if (j!=target){
  13.                             tmp.archi[x][y] = archi[i][j];
  14.                             y++;
  15.                         }
  16.                     }
  17.                     x++;
  18.                 }
  19.                 swap(tmp);
  20.             }
  21.             else
  22.           std::cout << "Nodo non presente" << std::endl;
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement